Thank you for your quick reply! That's a useful bit to keep in my SQL bag of tricks.
The SQL editor is accepting the syntax. But I think I still have a logic error. The error message is:
"Invalid length parameter passed to the Substring function."
Which is the original error I got and what prompted me to put in the extra logic...
I'm thinking maybe it is if the string is NULL or "". (???)
Is there a way to test additional conditions? Such as:
WHEN CHARINDEX(' ',Name) > 0) OR (Name = NULL)
Please excuse my ignorance... I was planning on creating a scalar text function but couldn't get past the syntax.