Friday, March 9, 2012

inside user define function can not use getdate() function?

Hi,
I can not use getdate() inside user define function? What can i
replace with that?
Thank you very much!
Best regards,
FlorenceThe best option is to pass it in...
CREATE FUNCTION YourFunction(@.param1, @.param2, ..., @.TheDate DATETIME)
...
SELECT ColA, ColB, ColC,
dbo.YourFunction(ColA, ColB, ColC, ..., GETDATE())
...
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic
--
"Florence Lee" <florencelee@.visualsolutions.com.my> wrote in message
news:OlK%23p%23V6EHA.2568@.TK2MSFTNGP10.phx.gbl...
> Hi,
> I can not use getdate() inside user define function? What can i
> replace with that?
> --
> Thank you very much!
> Best regards,
> Florence
>

No comments:

Post a Comment