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
 Transact-SQL (2000)
 These dates have stones in them

Author  Topic 

elwoos
Master Smack Fu Yak Hacker

2052 Posts

Posted - 2005-04-18 : 06:21:40
I'm a bit confused about GETDATE.

Sometimes if I put GETDATE I get a syntax error and sometimes if I put GETDATE() I get a syntax error. In most cases swapping to the other seems to work.

Can anyone explain this?

steve

A sarcasm detector, what a great idea.

robvolk
Most Valuable Yak

15732 Posts

Posted - 2005-04-18 : 07:11:08
GETDATE is a function, so I can't see how it will work without the parentheses. If you need another option, there's the ODBC version: CURRENT_TIMESTAMP. This has no parentheses.
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2005-04-18 : 07:37:19
Perhaps its what you are doing with the GetDate() [return value] that is causing the error?

Kristen
Go to Top of Page

elwoos
Master Smack Fu Yak Hacker

2052 Posts

Posted - 2005-04-18 : 08:07:45


I've finally sussed it! The GETDATE() was in an insert in a statement block. I'd forgotten to put an END in there

Thanks guys


steve

A sarcasm detector, what a great idea.
Go to Top of Page
   

- Advertisement -