Hi,
The below are the values stored in DB.
2013.ack
2013.regres
2013.zip.ack
Here I need to trim the values before the last dot(.).
The output should be like below
2013.
2013.
2013.zip.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Ramchand RepallePosted Oct 25, 2014, 11:16 AM
Please try with below sample
DECLARE @Expression NVARCHAR(100)
SET @Expression = 'abc.test.sd'
SELECT SUBSTRING(@Expression,1,LEN(@Expression)-(CHARINDEX('.',REVERSE(@Expression))-1))
Thanks,
Ramchand