|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
TSQL date helpIn TSQL how would I set my WHERE clause to pull records with ApptDate in the
past 3 months i.e. > (today-90 days) ? TIA -- sam SELECT DATEADD(Day, -90, GETDATE())
-or- ApptDate > DATEADD(Day, -90, GETDATE()) Hope this is a start. Show quote "smk23" <sm***@discussions.microsoft.com> wrote in message news:CED4F611-66E2-44A5-90E3-547E2CE955FA@microsoft.com... > In TSQL how would I set my WHERE clause to pull records with ApptDate in the > past 3 months i.e. > (today-90 days) ? > > TIA > -- > sam Can you try:
DateAdd(mm, 3, ApptDate) < getdate(). Perayu Show quote "smk23" <sm***@discussions.microsoft.com> wrote in message news:CED4F611-66E2-44A5-90E3-547E2CE955FA@microsoft.com... > In TSQL how would I set my WHERE clause to pull records with ApptDate in > the > past 3 months i.e. > (today-90 days) ? > > TIA > -- > sam |
|||||||||||||||||||||||