strantheman
Programmer
I know I should post this in the SQL forum but CF programmers generally have more trouble shooting knowledge with different DB software.
Im just trying to get a CASE statement to work. Im testing on my web based ISP (onviasites.com). They're running MS SQL server (probably 7) and CF 4.5. I've tried two methods, and the error is not specific, just says "syntax error or access violation"
Method 1)
--get text and type, output "this is type1" or "this is type2"
select
text
, "type" =
CASE
when TypeID = 1 then "this is type1"
when TypeID = 2 then "this is type2"
else "other"
END
from myTable
Method 2)
SELECT text,
CASE TypeID
WHEN = 1
THEN 'type 1'
ELSE 'other other other'
END
FROM myTable
Any SQL server saviors out there?
Im just trying to get a CASE statement to work. Im testing on my web based ISP (onviasites.com). They're running MS SQL server (probably 7) and CF 4.5. I've tried two methods, and the error is not specific, just says "syntax error or access violation"
Method 1)
--get text and type, output "this is type1" or "this is type2"
select
text
, "type" =
CASE
when TypeID = 1 then "this is type1"
when TypeID = 2 then "this is type2"
else "other"
END
from myTable
Method 2)
SELECT text,
CASE TypeID
WHEN = 1
THEN 'type 1'
ELSE 'other other other'
END
FROM myTable
Any SQL server saviors out there?