joycesolomon
MIS
Hi I have the below order by statement
ORDER BY CASE WHEN [Last Name] IS NULL THEN CASE WHEN [First Name] IS NULL
THEN [Company] ELSE [First Name] END ELSE CASE WHEN [First Name] IS NULL
THEN [Last Name] ELSE [Last Name] + ',' + [First Name] END ELSE CASE WHEN [Last Name] IS NULL THEN CASE WHEN [First Name] IS NULL
THEN [Company] ELSE [First Name] END ELSE CASE WHEN [First Name] IS NULL THEN [Last Name] ELSE [First Name] + ',' + [Last Name] END
I keep getting error "incorrect syntax near the keyword "ELSE""
Can someone please coach me
thanks
ORDER BY CASE WHEN [Last Name] IS NULL THEN CASE WHEN [First Name] IS NULL
THEN [Company] ELSE [First Name] END ELSE CASE WHEN [First Name] IS NULL
THEN [Last Name] ELSE [Last Name] + ',' + [First Name] END ELSE CASE WHEN [Last Name] IS NULL THEN CASE WHEN [First Name] IS NULL
THEN [Company] ELSE [First Name] END ELSE CASE WHEN [First Name] IS NULL THEN [Last Name] ELSE [First Name] + ',' + [Last Name] END
I keep getting error "incorrect syntax near the keyword "ELSE""
Can someone please coach me
thanks