Hello.
Can anyone tell me how to properly combine Sql String Functions?
I have the following data to export and I need to remove everything after the first hyphen. Everything else is either an episode number or a description.
I have alot of records with this issue.
Please advise on how I can properly combine string functions to remove all text after the first hyphen.
Can anyone tell me how to properly combine Sql String Functions?
I have the following data to export and I need to remove everything after the first hyphen. Everything else is either an episode number or a description.
Code:
Program
SPECIALS-MVSP7EDDIE - ENTIRELY EDDIE...ENTIRELY GENIUS
Program
IRON RING-BRNG-08002
SELECT CASE WHEN LEFT(Program, 6) IN ('-') THEN LTRIM(LEFT(Program, LEN(Program) - 5)) END AS UPD, Program, Network
FROM SampleEpisodes
I have alot of records with this issue.
Please advise on how I can properly combine string functions to remove all text after the first hyphen.