SQL Server Performance

subquery and function

Discussion in 'General Developer Questions' started by sardinka22, Aug 28, 2006.

  1. sardinka22 New Member

    I have a subquery where I get 2 rows back which cause issues (since I can't return more then one). I am using this subquery in my function and I can't use a temp table in order to select the correct value. what other options do I have . My subquery returns 2 dates and I need to return from my function the max date.
  2. Adriaan New Member

    The quick answer is: use MAX(date_column) in your subquery.

    The long answer is: show us the definition of the UDF to see if you really need a subquery, and show us from where you're calling the UDF to see if you really need the UDF.

Share This Page