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/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to