I'm not sure if SQL Server has issues with having an integer as the first character of a table name, but I suspect that is where the problem is. It's generally a good idea to not start any variable, table or column names with an integer, lest you run into weird issues. I would try wrapping the table name in brackets such as [2da] and see if that works.
-Justin Scott ----- Original Message ----- From: "Paul Giesenhagen" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Monday, March 10, 2003 9:58 AM Subject: OT: SQL Error with Syntax > OK, I cannot see where this SYNTAX error is can anyone else see the possible problem? Below are two queries, both are the same, one is PRE-CF (variables) one is POST CF after CF processes the variables that makes it a query. > > ----> (WHERE weight <= '30') Is just what is outputted in the error, it is actually ('30') > > > <!--- Dynamic Query ---> > SELECT zone#getzone.service# AS ship_value > FROM #variables.service_table# > WHERE weight <= '#attributes.weight#' > ORDER BY weight desc > > <!--- Above output ---> > SELECT zone202 AS ship_value > FROM 2da > WHERE weight <= '30' > ORDER BY weight desc > > <!--- PRODUCES This Error ---> > Error Executing Database Query. > [Macromedia][SQLServer JDBC Driver][SQLServer]Line 2: Incorrect syntax near '2'. > > 181 : WHERE weight <= '#attributes.weight#' > 182 : ORDER BY weight desc > 183 : </cfquery> > 184 : <cfset variables.process = "Yes"> > 185 : <cfset variables.ups_rate = getrate.ship_value> > > VENDORERRORCODE 170 > SQLSTATE HY000 > > Paul Giesenhagen > QuillDesign > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Get the mailserver that powers this list at http://www.coolfusion.com Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4