imstillatwork
IS-IT--Management
a table has clinic_name, name_f, and name_l
If the clinic_name is blank, I want to use 'name_f name_l' instead. I want to sort by this also, so can I write a CASE statement that will check if the clinic_name is null or blank and assign the alias accordingly?
Like this? (doesn't work, and I left out the concat() for the name_f & name_l)
CASE
WHEN clinic_name1 = '' THEN name_l AS title
ELSE clinic_name1 AS title
END
Kevin
Phase 1: Read the CFML Reference
Phase 2: ???
Phase 3: Profit!
If the clinic_name is blank, I want to use 'name_f name_l' instead. I want to sort by this also, so can I write a CASE statement that will check if the clinic_name is null or blank and assign the alias accordingly?
Like this? (doesn't work, and I left out the concat() for the name_f & name_l)
CASE
WHEN clinic_name1 = '' THEN name_l AS title
ELSE clinic_name1 AS title
END
Kevin
Phase 1: Read the CFML Reference
Phase 2: ???
Phase 3: Profit!