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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help with sql statement 1

Status
Not open for further replies.

jeevenze

Technical User
Mar 13, 2001
62
US
I've a table with all the dates for this year. I've built a query where the results return all the dates upto the current date...what i need help with is that I want the query to return only 21 results or any other method that returns 21 dates prior to today. The current SQL statement i have is:

SELECT tbldate.zdate, tbldate.zday
FROM tbldate
WHERE (((tbldate.zdate)<Date()));


thank you in advance to anyone who responds

Jeevenze
 
SELECT tbldate.zdate, tbldate.zday
FROM tbldate
WHERE (((tbldate.zdate)BETWEEN Date() and Date() -21));

Terry M. Hoey
th3856@txmail.sbc.com
While I don't mind e-mail messages, please post all questions in these forums for the benefit of all members.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top