|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Select Statement based on Date CriteriaI am trying to extract data based on the following:
Select * from table where datefield < OneMonthAgo WHen I try the DATEADD, it gives me everything from one month ago to today. I want everything on the other side of one month ago. This is what I currently have select custid, billname, crtd_DateTime, OrdDate, status, cancelled, * from soheader where soTypeID = '200' and (OrdDate < DateAdd(mm, -1, GETDATE())) Cheers, Leslie Never Mind, they syntax below IS correct!!! I was using old data and, well,
I was confused! :O) Cheers, Leslie Show quote "Leslie" wrote: > I am trying to extract data based on the following: > > Select * from table > where datefield < OneMonthAgo > > WHen I try the DATEADD, it gives me everything from one month ago to today. > I want everything on the other side of one month ago. > > This is what I currently have > select custid, billname, crtd_DateTime, OrdDate, status, cancelled, * from > soheader > where soTypeID = '200' and (OrdDate < DateAdd(mm, -1, GETDATE())) > > Cheers, > Leslie |
|||||||||||||||||||||||