Remove the # signs. You are telling cf to pass dateOfTotal to the server as a variable value.
-----Original Message----- From: Rick Faircloth [mailto:r...@whitestonemedia.com] Sent: Friday, November 05, 2010 4:21 PM To: cf-talk Subject: RE: I think I'm just making this way too hard... Well, I switched the DB and CF functions around in the statement, changed the CF function in the first half of the comparison to a DB (MySQL 5) function, and changed the column name throwing the error to "dateOfTotal" to be certain using "datetime" as a column name was not the problem. But I still get an error, and I can't figure out why. I even renamed the table, in case using a number at the start of the table name was problematic. select totalNew from a_dailyNumberNewHMLSProperties where date_add(now(), -1 days) = '#dateAdd('d', -1, dateOfTotal)#' Variable "dateOfTotal" is undefined. How can that column name be undefined? Why is it not being understood in the SQL? Aaaaahhhh! ??? -----Original Message----- From: Ian Skinner [mailto:h...@ilsweb.com] Sent: Friday, November 05, 2010 3:49 PM To: cf-talk Subject: Re: I think I'm just making this way too hard... On 11/5/2010 12:14 PM, Rick Faircloth wrote: > What am I doing wrong? (Besides mostly likely making this > waaaaay harder than it should be... just fog on the brain today) > > Rick On 11/5/2010 12:25 PM, Ian Skinner wrote: > You need to be using a database function around the database column, > which for date functions varies from DBMS to DBMS. P.S. And while there would be nothing wrong with continuing to use a ColdFusion function to create the date time value to be compared to the results of the database function us choose to use around the database column. It might just be simpler to use database function through out, as all DBMS have perfectly fine functions to get the current time from the system. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:338866 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm