Hi Everyone,
Here's my problem this week
I have a database full of events. The eventday field holds the date of the event - in access it is a date/time field. On the events page of my site, I list all the events. What I want to do is list only the ones that are today, or in the future. So I use DateCompare like this:
<cfset today=dateformat(Now(),"mm-dd-yy"
>
<CFIF DateCompare(eventday, today) NEQ -1>
blah blah blah
</CFIF>
This works to return all the future events, but it won't show any of the current days' events. I'm ASSUMING this is because the database specifies the time along with the date, so it thinks all the events are happening at midnight, since all the times are 00:00:00. So if an event is scheduled to happen today, it thinks it already happened at midnight that morning. So how do I get datecompare to ignore the time? I've already tried using dateformat to format everything with just dates, no times, but that doesn't seem to work. Any ideas?
Here's my problem this week
I have a database full of events. The eventday field holds the date of the event - in access it is a date/time field. On the events page of my site, I list all the events. What I want to do is list only the ones that are today, or in the future. So I use DateCompare like this:
<cfset today=dateformat(Now(),"mm-dd-yy"
<CFIF DateCompare(eventday, today) NEQ -1>
blah blah blah
</CFIF>
This works to return all the future events, but it won't show any of the current days' events. I'm ASSUMING this is because the database specifies the time along with the date, so it thinks all the events are happening at midnight, since all the times are 00:00:00. So if an event is scheduled to happen today, it thinks it already happened at midnight that morning. So how do I get datecompare to ignore the time? I've already tried using dateformat to format everything with just dates, no times, but that doesn't seem to work. Any ideas?