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
 get last three month date in sql

Author  Topic 

amirs
Constraint Violating Yak Guru

260 Posts

Posted - 2010-07-21 : 02:37:16
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)

17689 Posts

Posted - 2010-07-21 : 02:47:15
dateadd(month, -3, current_date)


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

amirs
Constraint Violating Yak Guru

260 Posts

Posted - 2010-07-21 : 03:21:38
thanks dear
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-07-21 : 05:02:14
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
   

- Advertisement -