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.
Author |
Topic |
eugz
Posting Yak Master
210 Posts |
Posted - 2011-02-24 : 12:05:40
|
Hi AllI would like to cut left part data of the field. But unfortunately length of data in this field is not the same. Example data looks likeASDDH.CFGFG.MMM.GGGHGFHASD.JKSDFY.MMM.NNNI need only left part of data. If is possible how it to do?Thanks. |
|
MIK_2008
Master Smack Fu Yak Hacker
1054 Posts |
Posted - 2011-02-24 : 12:08:13
|
can you specify exactly the Left Part?CheersMIK |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2011-02-24 : 12:12:36
|
select left(col,charindex('.',col)-1) from tableMadhivananFailing to plan is Planning to fail |
|
|
eugz
Posting Yak Master
210 Posts |
Posted - 2011-02-24 : 12:14:15
|
I mean value before first period from left. The result will looksASDDHHGFHASDThanks. |
|
|
MIK_2008
Master Smack Fu Yak Hacker
1054 Posts |
Posted - 2011-02-24 : 12:15:01
|
use what Madhi suggestedCheersMIK |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2011-02-24 : 12:24:10
|
or parsename(col,4)MadhivananFailing to plan is Planning to fail |
|
|
|
|
|