
Signature
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: http://cerbermail.com/?QugbLEWINF
Thanks, i accidentally copied an extra ). Even with changing it, i
still get an error message. I am using it in a function, here is the
full sql:
SELECT [e-mail] AS Email, FName, LName, Birthday
FROM dbo.tblChild
WHERE (Auditions = 1) AND ([e-mail] IS NOT NULL) AND (Birthday >
DATEADD(year, - 19, CONVERT(char(10), GETDATE(), 101)))
Thanks for the help.
Sylvain Lafontaine - 28 Feb 2006 20:51 GMT
You cannot use GetDate() inside a User Defined Function (UDF) because UDF
must be deterministic; ie. returning the same result when called with the
same argument(s).
You will have to pass the value of GetDate() as an argument to the function.

Signature
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: http://cerbermail.com/?QugbLEWINF
> Thanks, i accidentally copied an extra ). Even with changing it, i
> still get an error message. I am using it in a function, here is the
[quoted text clipped - 6 lines]
>
> Thanks for the help.
JEM - 28 Feb 2006 21:03 GMT
I didn't know that. Thanks.
Robert Morley - 28 Feb 2006 21:10 GMT
Yes, I discovered that some time ago...pain in the posterior, isn't it?!?
It would be nice to be able to designate a function as being
pseudo-deterministic...in this case, able to assume one value for the entire
view/command/whatever being executed, but should not be assumed to be for a
different connection/view/command/whatever.
Don't suppose they added that in SQL 2005?
Rob