SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 get last three month date in sql
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

amirs
Constraint Violating Yak Guru

India
259 Posts

Posted - 07/21/2010 :  02:37:16  Show Profile  Reply with Quote
hi

please tell how to get last three month date to current date in sql
like
current date : 21/07/2010
last 3 month date : 21/04/2010

khtan
In (Som, Ni, Yak)

Singapore
17638 Posts

Posted - 07/21/2010 :  02:47:15  Show Profile  Reply with Quote
dateadd(month, -3, current_date)


KH
Time is always against us

Go to Top of Page

amirs
Constraint Violating Yak Guru

India
259 Posts

Posted - 07/21/2010 :  03:21:38  Show Profile  Reply with Quote
thanks dear
Go to Top of Page

madhivanan
Premature Yak Congratulator

India
22761 Posts

Posted - 07/21/2010 :  05:02:14  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
and if you want to find all those data,

where date_col>=dateadd(month, -3, getdate())

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.11 seconds. Powered By: Snitz Forums 2000