Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Range

Status
Not open for further replies.

strom99

MIS
Nov 28, 2000
126
US
WHERE
detail.rqst_del_date >= ''01/01/'' + datename(year,getdate()) and detail.rqst_del_date <= dateadd(month, 8, getdate())

I have the above in my where clause, but I need to make a change in order to go back 6 months from the first of this month, so I would include all records from July 1 2002 to 8 months from today. SQL Server 2000

Thanks much!!
 
SELECT * FROM myTable
WHERE rqst_del_date BETWEEN
dateAtt(m,cast(datePart(m, getDate()) + '/1/' + datePart(yyyy, getDate()) as smalldatetime),-6) AND dateAdd(m, getDate(),8) Get the Best Answers! faq333-2924
Happy 2003! [cheers]
mikewolf@tst-us.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top