Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 System functions within UD functions

Author  Topic 

ajthepoolman
Constraint Violating Yak Guru

384 Posts

Posted - 2005-05-17 : 10:46:08
Am I totally missing something here or can I not run GETDATE() within a user defined function?

I have tried dbo.GETDATE() and that didn't work either. Is the only option to pass the date into the function as a parameter?

Thanks!

Aj

JimL
SQL Slinging Yak Ranger

1537 Posts

Posted - 2005-05-17 : 11:14:46
Please post your code so we can help you.

Jim
Users <> Logic
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2005-05-17 : 11:18:59
Pool Dude!

Long time.

No determistic functions can not be used in udf's

Nothing stopping you from passing it in as a variable though.....



Brett

8-)
Go to Top of Page

ajthepoolman
Constraint Violating Yak Guru

384 Posts

Posted - 2005-05-17 : 11:25:47
quote:
Originally posted by X002548

Pool Dude!

Long time.

No determistic functions can not be used in udf's

Nothing stopping you from passing it in as a variable though.....



Brett

8-)



Hey Brett, nice talking to ya!

So, which dunce on Mount SQL decided that you would not be allowed to do something as simple as SET @dtiToday = GETDATE() within a user defined function? I have had to do exactly as you said and add parameters to my functions to pass the date in. It is a pain in the butt!

Aj
Go to Top of Page
   

- Advertisement -