You should be able to use CHARINDEX and LEFT together to get what you need.

https://stackoverflow.com/questions/40924008/how-to-use-substring-and-patindex-in-sql-server
_________________________
Remind me to change my signature to something more interesting someday