Sunday, March 11, 2012

Date Function

In SQL 2000 I need to return all records where the date is between date() and date()-365. I can not seem to get the syntax right. Any help would be appriciated.Try this:
where date between dateadd(dd,-365,getdate()) and getdate()

Good Luck.|||you can try also this

where date between dateadd(yy,-1,getdate()) and getdate()|||

Quote:

Originally Posted by iburyak

Try this:
where date between dateadd(dd,-365,getdate()) and getdate()

Good Luck.


Thanks, that did the trick

No comments:

Post a Comment