December 8, 2014 at 3:45 am
hi,
i want a query that retrive last two months data from today date.
please help me out.
thanks for the help.
immad
December 8, 2014 at 4:10 am
Have a look at this page[/url] it'll point you in the right direction. We can't do much else without some input from you though. Can you post some sample data please?
How to post a question to get the most help http://www.sqlservercentral.com/articles/Best+Practices/61537
December 8, 2014 at 4:12 am
Combination of this
http://msdn.microsoft.com/en-us/library/ms188383.aspx
and this
http://msdn.microsoft.com/en-us/library/ms186819.aspx
Should do the trick
December 8, 2014 at 4:15 am
select * from table where datecol between DATEADD(M,-2,getdate()) and GETDATE()
Thanks,
Shiva N
Database Consultant
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply