Hi.
I have a database which has two fields called event_start_date and event_end_date (every record has to have a start date, but not every record has to have an end date).
The problem I've got is that I want to only display records from today onwards (old records stay in the database until they're deleted, but they just don't display), but if I'm ordering records by event_start_date they go away if their event_start_date is before today. What I need, in pseudo-code, is this:
<cfif event_end_date IS NOT "none" AND [today's date] IS BETWEEN event_start_date [and] event_end_date>
write record
<cfelseif event_end_date IS "none" [check if record's event is today or after, and if it is display it]>
write record
</cfif>
ie check whether the event has an end date. if it doesn't, and event_start_date is after today, display record. If the event _has_ an end date, check to see whether today's date is between event_start_date and _event_end_date and if it is, display the record.
anyone any ideas?
Ian
[sig][/sig]
I have a database which has two fields called event_start_date and event_end_date (every record has to have a start date, but not every record has to have an end date).
The problem I've got is that I want to only display records from today onwards (old records stay in the database until they're deleted, but they just don't display), but if I'm ordering records by event_start_date they go away if their event_start_date is before today. What I need, in pseudo-code, is this:
<cfif event_end_date IS NOT "none" AND [today's date] IS BETWEEN event_start_date [and] event_end_date>
write record
<cfelseif event_end_date IS "none" [check if record's event is today or after, and if it is display it]>
write record
</cfif>
ie check whether the event has an end date. if it doesn't, and event_start_date is after today, display record. If the event _has_ an end date, check to see whether today's date is between event_start_date and _event_end_date and if it is, display the record.
anyone any ideas?
Ian
[sig][/sig]