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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Ramchand RepalleRank #762 · 3K reputationPosted Oct 25, 2014, 7:16 AM EDT
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