You probably want to change the precision of the datecompare() function.

by default, DateCompare is precise to the second.
So, this might help:

<CFSET comparison = DateCompare(CurrentDate,expiration_date,"d">


-----Original Message-----
From: Bosky, Dave [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 21, 2000 11:58 AM
To: CF-Talk
Subject:


I'm trying to compare the current date to an expire-on date and mark the ad
as expired if the datecompare function returns a value gte 0. Everything
seems
ok except that it marks every ad as expired regardless of returned value.

<CFLOOP QUERY="GetEntries">
<CFSET AdWasPlacedOnThisDate = posted_on>
<CFSET expiration_date = #dateformat(DateAdd('D', 30,
AdWasPlacedOnThisDate), "DD-MMM-YY")#>
<CFSET comparison = DateCompare(CurrentDate,expiration_date>
<CFIF comparison GTE 0>
<CFQUERY datasource="xxx" DBTYPE="ODBC">
        UPDATE Ads
        SET online_approval = '2'
        WHERE ad_id = ad_id
</CFQUERY>
</CFIF>
</CFLOOP>

Thanks

Dave Bosky
HTC Web Application Developer
843.369.8613
[EMAIL PROTECTED]

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to