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
 General SQL Server Forums
 New to SQL Server Programming
 syntax help...

Author  Topic 

sinjin67
Yak Posting Veteran

53 Posts

Posted - 2008-12-22 : 18:43:25
I am have trouble with the syntax and was hoping someone might
see the error. I think I am close on this.. I am trying to get
my function to delete all records over 90 days and have a archive
value of 1. It works fine without the "and arc = 1"


varQuery = "DELETE FROM Label01 WHERE DATEDIFF(dd,date,GETDATE()<=90 and arc=1"


Any help would be great..thank you

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-12-22 : 18:55:00
You are missing a closing parenthesis.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

sinjin67
Yak Posting Veteran

53 Posts

Posted - 2008-12-22 : 19:00:12
Thanks... Been working on it for a bit and just could,nt
see it anymore..

Thanks again...
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-12-22 : 19:05:37
Glad to help, let us know if you have any other issues.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -