JohnPell
asked on
Sybase SQL CASE statement problem
Hello Experts, I am creating a SQL query in Crystal Reports to run against a Sybase db. My select statement is
SELECT
ad.line1
case
when en.firm is not NULL then en.firm
else en.first_name || ' ' || en.last_name AS Name
end
case
when en.taxid is not NULL then en.taxid
else en.ssno
end
FROM
The CASE statements are not working. What am I doing wrong? Should I use COALESCE instead? If so, how would I write that?
SELECT
ad.line1
case
when en.firm is not NULL then en.firm
else en.first_name || ' ' || en.last_name AS Name
end
case
when en.taxid is not NULL then en.taxid
else en.ssno
end
FROM
The CASE statements are not working. What am I doing wrong? Should I use COALESCE instead? If so, how would I write that?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER