July 27, 2005 at 10:45 am
Ideally, it would have a default of getdate(), but since that's non-deterministic, I need to require a value.
How can I swing this?
July 27, 2005 at 11:09 am
Just have your function deal with a null using coalesce,
Not knowing what your function does , this will return datein + 10 days.
Select @output = dateadd(dd, coalesce(@inParam,getdate()),10)
July 27, 2005 at 11:16 am
thanks, but that's still non-deterministic. I don't think you can have getdate() in the body of a UD Function at all.
July 27, 2005 at 11:45 am
You are correct you cannot use GETDATE() inside a UDF. However, you CAN pass it as a parameter. udf_GETDATE(@Today) where @Today was SET = to GETDATE()
Good Hunting!
AJ Ahrens
webmaster@kritter.net
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply