SQL to display an event on start date, end date and any days in between.

Posted by Tim on Stack Overflow See other posts from Stack Overflow or by Tim
Published on 2010-05-02T23:17:02Z Indexed on 2010/05/02 23:28 UTC
Read the original article Hit count: 252

Filed under:
|
|

Hello,

This should be fairly simple, but I can't get my head around it.

I have an event in my database with a startDate and an endDate.

I need to display this event (based on the current date) on every day the event occurs.

So if the event starts on the 3rd of May and finishes on the 7th of May, the SQL query must find it on every single day.

How can I achieve this?

SELECT * FROM events WHERE startDate ???

Thanks,

Tim

© Stack Overflow or respective owner

Related posts about sql

Related posts about events