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

Date range from a single Date

Status
Not open for further replies.

d0nny

IS-IT--Management
Dec 18, 2005
278
GB
Hi

I have a football fixtures table with a date of the fixture stored with the fixture.
I want to display this fixture on my website for (say) 3 days before the actual fixture date and (say) 3 days after the actual fixture date.
Is this possible from within a single query?
I think this might have something to do with the DATEADD/DATESUB functions, but I can't work out how to use these in the WHERE clause of my query.

Any help appreciated.
 
How about something like:
[tt]
WHERE
fixdate
BETWEEN CURDATE() - INTERVAL 3 DAY
AND CURDATE() + INTERVAL 3 DAY
[/tt]
 
Thanks.
I'll give it a try and let you know.
 

Worked a treat :)
Thanks a lot ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top