All,
I am attempting to return the results of an Exec ('Select..') statement. In short, I am passing in a field name in a UDF and have success executing the sql statement, but can only view the result in the 'results' pane. Here is the statement that works:
exec ('SELECT max(' + @FldName + ')FROM root_SCRCVC')
What I would like to do is get the result of this statement(datetime) and return this from my function i.e.
Return @ret.
Any suggestions here?
Thanks in advance -
Scottie
I am attempting to return the results of an Exec ('Select..') statement. In short, I am passing in a field name in a UDF and have success executing the sql statement, but can only view the result in the 'results' pane. Here is the statement that works:
exec ('SELECT max(' + @FldName + ')FROM root_SCRCVC')
What I would like to do is get the result of this statement(datetime) and return this from my function i.e.
Return @ret.
Any suggestions here?
Thanks in advance -
Scottie