Lewis, Your <CFIF> won't work because it's ColdFusion, and it won't evaluate each row of the query as the SQL Server is doing that.
Try putting () around the entire CASE statement (CASE.....END) Dave -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 28, 2008 12:17 PM To: cf-newbie Subject: Re: Numerical order of query results By the way, this is the error I get: Error Executing Database Query. [Macromedia][SQLServer JDBC Driver][SQLServer]Incorrect syntax near the keyword 'CONVERT'. Also, you should know that this query is in a component, which is called by another component (if it makes any difference). I also tried this: <cfif a.ClCo EQ '01DEMO'> a.ClCo <cfelse> CONVERT(numeric(8), a.ClCo) </cfif> But, then got an error saying: "Element CLCO is undefined in A" I don't get it. It was defined when I didn't bother with the 'if" statement. Thanks, Lewis ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-newbie/message.cfm/messageid:4098 Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15
