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
</cfquery>

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

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: http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/functi56.htm#wp4762855

0 Comments:

Post a Comment

<< Home