I've actually run the query successfully from 4.5 and 5.0b1 -- I'm thinking
we might be in bug territory. 

Rename the column from switch to something else, in case there is some CF
confusion regarding switch-case (i.e. a bug in 4.01). I know that sounds
implausible, but I can't replicate the error here with later versions, and
I'm out of ideas. 

And I would also run Dave's example, (SELECT LEFT(123456,3) + '1' +
right(123456, len(123456) -4) as test) to see if the problem is specific to
your table, or if it's the syntax that's bombing.

HTH,

Michael Caulfield

-----Original Message-----
From: Hayes, David [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 10, 2001 10:20 AM
To: CF-Talk
Subject: RE: update numeric SubString?


You're using string operations on numeric values; I assume MS-SQL is able to
resolve the discrepancy, but ODBC can't.

This statement works through CF: SELECT LEFT(123456,3) + '1' + right(123456
, len(123456) -4) as test.

You could put the whole thing in a "CAST" statement, or you could use math
functions on your data:
select round(123456,-3) + (1*100) + (123456 % 100) as test



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to