Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
I have a table with field like S1S1.1S10S10.2I need to be able to trim so it only shows as S1S1S10S10in a seperate column in a view.The reults could be 2 or 3 characters and I have approx 50 different types that need to be trimmed.Any suggesions?
khtan
In (Som, Ni, Yak)
17689 Posts
Posted - 2009-11-16 : 23:21:07
remove anything after the dot ?
select case when charindex('.', col) <> 0 then left(col, charindex('.', col) - 1) else col end
KH[spoiler]Time is always against us[/spoiler]
Les.61
Starting Member
49 Posts
Posted - 2009-11-16 : 23:39:32
KH Worked a treat. Yes it was to delete anything after the dot.Many Thanks