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 |
|
osirisa
Constraint Violating Yak Guru
289 Posts |
Posted - 2009-01-09 : 13:00:38
|
Hi Group:Quick question... How can I select only information from 60 days to the present date?getdate()-60Thanks for the help!!!! |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-01-09 : 13:02:35
|
| [code]select * from table where datefield>getdate()-60 and datefield<=getdate()[/code] |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
osirisa
Constraint Violating Yak Guru
289 Posts |
Posted - 2009-01-09 : 13:36:39
|
| Thank you |
 |
|
|
Nageswar9
Aged Yak Warrior
600 Posts |
Posted - 2009-01-09 : 22:39:57
|
| select * from urtable where datefield BETWEEN DATEADD(d,DATEDIFF(d,0,GETDATE()-60),0) AND DATEADD(d,DATEDIFF(d,0,GETDATE()),0) |
 |
|
|
Jai Krishna
Constraint Violating Yak Guru
333 Posts |
Posted - 2009-01-09 : 22:46:39
|
| select * from table where datefield>dateadd(d,datediff(d,0,getdate()-60),0) and datefield<=dateadd(d,datediff(d,0,getdate()),0)Jai Krishna |
 |
|
|
|
|
|
|
|