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 END,
CASE WHEN [Last Name] IS NULL THEN CASE WHEN [First Name] IS NULL THEN [Company] ELSE [First Name] END CASE WHEN [First Name] IS NULL
THEN [Last Name] ELSE [First Name] + ',' + [Last Name] END END
I keep getting error "incorrect syntax near the keyword "CASE""
Can someone please coach me
thanks
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 END,
CASE WHEN [Last Name] IS NULL THEN CASE WHEN [First Name] IS NULL THEN [Company] ELSE [First Name] END CASE WHEN [First Name] IS NULL
THEN [Last Name] ELSE [First Name] + ',' + [Last Name] END END
I keep getting error "incorrect syntax near the keyword "CASE""
Can someone please coach me
thanks