Link to home
Start Free TrialLog in
Avatar of JohnPell
JohnPellFlag for United States of America

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?
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JohnPell

ASKER

Thanks! I did have to had a comma between the case statements, but it works fine.