S
Si
Hi all,
I have an events database (Access) that contains 2 fields, StartDate and
EndDate. The fields are set as Date/Time long date. The server is UK
date format (dd/mm/yyyy)
I have a small calendar that changes the day of the month to a link if
an event exists for that day.
I start off on day 1 of the month and use a loop through the month until
the last day. Each run through the month queries the DB to see if an
events exists with this sql:
sql="SELECT ListingsID FROM tblEventsListings WHERE StartDate <= #" &
DispDate & "# AND EndDate >= #" & DispDate & "#;"
The DispDate is generated as part of the loop and is producing the date
correctly.
My problem is that if an event has the same start/finish day (single day
event) then it gets missed. Also, an event that runs over a couple of
months seems to randomly be displayed. eg, the calendar will show an
event exists for 4 days, then 5 days of no event then events exist for
the rest of the month. (The whole month should reflect an event on every
day.)
Sorry if this is a bit long winded! I'm stumped! Is there a better way
to do this loop?
Simon
I have an events database (Access) that contains 2 fields, StartDate and
EndDate. The fields are set as Date/Time long date. The server is UK
date format (dd/mm/yyyy)
I have a small calendar that changes the day of the month to a link if
an event exists for that day.
I start off on day 1 of the month and use a loop through the month until
the last day. Each run through the month queries the DB to see if an
events exists with this sql:
sql="SELECT ListingsID FROM tblEventsListings WHERE StartDate <= #" &
DispDate & "# AND EndDate >= #" & DispDate & "#;"
The DispDate is generated as part of the loop and is producing the date
correctly.
My problem is that if an event has the same start/finish day (single day
event) then it gets missed. Also, an event that runs over a couple of
months seems to randomly be displayed. eg, the calendar will show an
event exists for 4 days, then 5 days of no event then events exist for
the rest of the month. (The whole month should reflect an event on every
day.)
Sorry if this is a bit long winded! I'm stumped! Is there a better way
to do this loop?
Simon