Saturday, April 16, 2005

Coldfusion Date Compare

Question: I am trying to compare dates in a query between today, and every date in my db.

<cfquery datasource="Parks" name="AllEventDates">
SELECT * from Events

<cfoutput query="AllEventDates">
<cfset comparison = DateCompare(#DateFormat(Now())#,,#DateFormat(AllEventDates.Expires, "mmm/dd/yyyy")#)>

Apparently that is wrong, and I don't know how to compare dates in SQL.

Answer: Well, for starters to get you going, here's the reference page for DateFormat:


Post a Comment

<< Home