Monday, March 12, 2012

FAIL TO USE GETDATE() ON A FUNCTION

I have created my function call a getdate(). After running my function I get
the following error message:
INVALID USE OF GETDATE() IN A FUNCTION.
Is there any alternative to this as I need to know the current date in my
function?Search the archives and you will find workarounds and the reason for this. O
ne workaround is to
create a view in which you call getdate and use that view. But be aware that
this makes getdate
non-atomic and non-deterministic.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Comfort P." <comfort.peter@.stcl.com> wrote in message news:u3hj6nu0EHA.3468@.TK2MSFTNGP14.ph
x.gbl...
> I have created my function call a getdate(). After running my function I g
et
> the following error message:
> INVALID USE OF GETDATE() IN A FUNCTION.
> Is there any alternative to this as I need to know the current date in my
> function?
>|||Also see http://www.aspfaq.com/2439
http://www.aspfaq.com/
(Reverse address to reply.)
"Comfort P." <comfort.peter@.stcl.com> wrote in message
news:u3hj6nu0EHA.3468@.TK2MSFTNGP14.phx.gbl...
> I have created my function call a getdate(). After running my function I
get
> the following error message:
> INVALID USE OF GETDATE() IN A FUNCTION.
> Is there any alternative to this as I need to know the current date in my
> function?
>

No comments:

Post a Comment