Outstanding! That was it (the filePostDate value not existing problem). Thanks Jim and Ryan.
Thanks, Mark -----Original Message----- From: Jim Wright [mailto:[EMAIL PROTECTED] Sent: Monday, November 27, 2006 9:26 AM To: CF-Talk Subject: Re: DateAdd in Query Statement Mark Leder wrote: > I'm attempting to filter a query set based on a date. However, it > looks like the DateAdd function is not in an ODBC format, so I can't > compare the current date to the filePostDate + twgFileExpDate. I've > looked around CFLib without success. How would I write this? > > <cfset ARGUMENTS.twgFileExpDate = 21> > > SELECT F.fileURL, F.filePostDate, F.caseID FROM > #APPLICATION.prefix#_Clients_Files_List F WHERE F.caseID = > <cfqueryparam cfsqltype="cf_sql_char" > value="#ARGUMENTS.caseID#"> > AND #CreateODBCDateTime(Now())# <= > #DateAdd('D',ARGUMENTS.twgFileExpDate,F.filePostDate)# > You are trying to do the dateadd on F.filePostDate on the CF side of things, but the F.filePostDate value will not exist until the query is being run...use a function on the db side of things... AND #CreateODBCDateTime(Now())# <= DATEADD(day, #ARGUMENTS.twgFileExpDate#, F.filePostDate) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:261717 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

