Friday, March 23, 2012

how to get the date 2years before

Hi
Can anyone please help me to get the date that is 2 years before .
So that i can pull put the records tht are 2 years older...

i want to use it in a query ...

Thanks in advanceUse this select dateadd(yy, -2, getdate())

or in quesry

where date < dateadd(yy, -2, getdate())

Good Luck.sql

No comments:

Post a Comment