I am trying to pull from a field called "Location" that includes a number of varying lengths after a dash. I only want to pull the value of the field before the dash. My expression below worked with the LTRIM to pull values after the dash but is not working for values before. What is wrong with the below statement?
COALESCE(RTRIM(SUBSTRING(Location,CHARINDEX('-',Location,1)+1
LEN(Location)-CHARINDEX('-',Location,1))),Location)




