79467175

Date: 2025-02-25 16:15:24
Score: 0.5
Natty:
Report link

This might appeal to someone it is based on work above:

IIF(charindex(' ', [YouColumn]) = 0, LEFT([YourColumn], LEN([YourColumn])), LEFT([YourColumn], charindex(' ', [YourColumn]) - 1)) AS NewColumnName

Sometime IIF is cleaner than CASE.

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Muskie