Link to home
Start Free TrialLog in
Avatar of 66chawger
66chawgerFlag for United States of America

asked on

SQL 2008 How to specify column name when using case statement

This should be simple... How to specify a column name "as ....." when using a case statement (in bold below).

COALESCE(T1.POSTCODE_FW, '') as 'Zip Code',
COALESCE(T1.VENDOR_SPECIALTY_FW, '') as 'Vendor Specialty',
COALESCE(T1.VENDOR_TYPE_FW, '') as 'Vendor Type',

CASE
      WHEN T1.SUPSTATUS_FW = '0' THEN ''
      WHEN T1.SUPSTATUS_FW = '1' THEN 'YES'
      ELSE ''
END,


COALESCE(CONVERT(varchar(10), T2.START_DATE_FW, 101), '') as 'Start Date',
COALESCE(CONVERT(varchar(10), T2.END_DATE_FW, 101), '') as 'End Date',
ASKER CERTIFIED SOLUTION
Avatar of Aneesh
Aneesh
Flag of Canada 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
SOLUTION
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
SOLUTION
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 66chawger

ASKER

Everyone, all of these were right on... I had the syntax incorrect.  I going to split up the points as everyone provided great info.
Awarded Aneesh half of the 500 as they were the first one to respond.