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.
| Author |
Topic |
|
vivo
Starting Member
24 Posts |
Posted - 2010-03-16 : 22:17:04
|
| How to checkDatecreated > (Current Date – 1 month and 15 days)Thanks |
|
|
namman
Constraint Violating Yak Guru
285 Posts |
Posted - 2010-03-16 : 22:38:33
|
| Using dateaddexample:select GETDATE() as CurrentDate, dateadd(d, -15, dateadd(m, -1, GETDATE())) as Monthand15DaysEarlier |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-03-17 : 01:34:33
|
| select GETDATE() as CurrentDate, dateadd(d, -15, dateadd(m,DATEDIFF(m,0,GETDATE())-1,0)) as Monthand15DaysEarlierif you need to consider absolute day------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|