Receiving an error when attempting to use a Select statement in a function. The error states:
Msg 444, Level 16, State 2, Procedure JDE_GetWhereClause
Found this MSDN article helpful and it resolved my issue:
RETURN (SELECT GETDATE());
Returning values directly from a select statement, avoiding variable.