I have an Event
table (used in a calendar application I am working on) that holds the following columns:
EventName
StartDate
EndDate
The events stored in said table get shown one month at a time, and that is working great, except that it does not return any events that span over into an adjacent month. For example, an event that runs from 2/25 - 3/05
.
I will only get events for the current month, provided the EndDate
is also within the month under consideration.
I know that this has to do with the statements I am writing. This is what I currently have:
SELECT *
FROM Events
WHERE StartDate >= '2/1/2011'
AND EndDate < '3/1/2011'
ORDER BY StartDate
The dates above are dynamic.