| Author |
Topic |
|
ismailc
Constraint Violating Yak Guru
290 Posts |
Posted - 2008-11-10 : 03:40:04
|
| Hi, I need help please!I need to return everything from the right of " : " string.String = Test : New DescriptionReturn = New DescriptionI thought of right & substring, the problem is the string varies and will change. eg: Test New : New Description TestPlease Assist!Regards |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-11-10 : 03:41:53
|
SELECT Col1, LTRIM(SUBSTRING(Col1, CHARINDEX(':', Col1) + 1))FROM Table1 E 12°55'05.63"N 56°04'39.26" |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-11-10 : 04:00:34
|
| [code]SELECT Col1, LTRIM(RIGHT(Col1, LEN(Col1)-CHARINDEX(':', Col1)))FROM Table1[/code] |
 |
|
|
ismailc
Constraint Violating Yak Guru
290 Posts |
Posted - 2008-11-10 : 04:07:37
|
| Thank You - Great StuffSelect rtrim(right(MyText,len(mytext)-charindex(' : ',MyText,1))) as MyResult |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-11-10 : 04:13:37
|
quote: Originally posted by Peso SELECT Col1, LTRIM(SUBSTRING(Col1, CHARINDEX(':', Col1) + 1,LEN(Col1)))FROM Table1 E 12°55'05.63"N 56°04'39.26"
|
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-11-10 : 04:47:16
|
| ORSELECT Col1, PARSENAME(REPLACE(Col1,':','.'),1)FROM Table1MadhivananFailing to plan is Planning to fail |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-11-10 : 05:03:41
|
quote: Originally posted by Peso SELECT Col1, LTRIM(SUBSTRING(Col1, CHARINDEX(':', Col1) + 1))FROM Table1 E 12°55'05.63"N 56°04'39.26"
SELECT Col1, LTRIM(SUBSTRING(Col1, CHARINDEX(':', Col1) + 1,,LEN(Col1)))FROM Table1MadhivananFailing to plan is Planning to fail |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-11-10 : 05:12:41
|
quote: Originally posted by madhivanan
quote: Originally posted by Peso SELECT Col1, LTRIM(SUBSTRING(Col1, CHARINDEX(':', Col1) + 1))FROM Table1 E 12°55'05.63"N 56°04'39.26"
SELECT Col1, LTRIM(SUBSTRING(Col1, CHARINDEX(':', Col1) + 1,,LEN(Col1)))FROM Table1MadhivananFailing to plan is Planning to fail
which is what i posted at 11/10/2008 : 04:13:37 |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-11-10 : 05:33:41
|
Thanks. I didnt notice it properly MadhivananFailing to plan is Planning to fail |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-11-10 : 05:38:40
|
quote: Originally posted by madhivanan Thanks. I didnt notice it properly MadhivananFailing to plan is Planning to fail
No problem |
 |
|
|
|