On 11/5/2010 1:20 PM, Rick Faircloth wrote: > Variable "dateOfTotal" is undefined. > How can that column name be undefined? Why is it not being > understood in the SQL?
Because ColdFusion is NOT your database server, it has NO IDEA what column exist or do not exist. It does not see 'dateOfTotal' as a database column. It sees it as a COLDFUSION variable. And it is telling you there is no such variable in your CFML code. All <cfquery...> does is bundle up a big string and send it to the database. It is the database the is able to parse the string into SQL commands and references to the Database schema, such as Column Names. To do what you want to do you need to include some strings that will represent DATABASE functions inside your <cfquery...> block, then when the string gets to the database server it will recognize them and give you the results you so desperately desire. Now I can't easily show you how this would work because database date and time functions vary considerably between one Database Management System and another. And you haven't told us what DBMS you are using. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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:338867 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm