smknox
Hall of Fame
Points: 3275
More actions
September 1, 2005 at 4:53 pm
#363569
In TSQL how would I set my WHERE clause to pull records with v.ApptDate in the past 3 months i.e. > (today-90 days) ?
TIA
Merrill Aldrich
SSCrazy
Points: 2358
September 1, 2005 at 4:54 pm
#587060
See the DateAdd and getdate functions
dateadd( "d", -90, getdate() )
dateadd( "mm", -3, getdate() ) etc.
Ninja's_RGR'us
SSC Guru
Points: 294069
September 1, 2005 at 5:27 pm
#587064
Make sure you don't use a function on a column (bad for performance).
Also please not that 90 days and 3 months are not the same thing .
September 1, 2005 at 5:58 pm
#587070
Thanks guys!
Sam
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply