I have strings like
WebApp - 10148
Smart - App - 1458
Expected Result
WebApp
Smart - App
I want to trim the characters from - to numbers from right.
I have tried the below query and the result is this
select LEFT(app+' - ', CHARINDEX(' - ',app+' - ')-1) from repository
WebApp
Smart
Can anyone assist me to sort this?
Try this:
reverse(right(reverse(@string), len(@string) - charindex('-',reverse(@string),1)));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With