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 |
|
funk.phenomena
Posting Yak Master
121 Posts |
Posted - 2012-08-13 : 09:56:00
|
| Hi All - I have the following Table:LOCATIONToronto: OntarioWinnipeg: ManitobaMontreal: QuebecOakfield: OntarioI need to use a text function so that it will output all the characters BEFORE the colon. How can I acheive this? Thanks!LOCATIONTorontoWinnipegMontrealOakfield[CODE]SELECT LOCATION FROM TABLE[/CODE] |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-08-13 : 09:58:27
|
| [code]SELECT LEFT(LOCATION,CHARINDEX(':',LOCATION + ':')-1) AS LocVal FROM Table[/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
funk.phenomena
Posting Yak Master
121 Posts |
Posted - 2012-08-13 : 10:02:02
|
| THANKS VISAKH !!!!!!!!!!!!!!!!!!!!! |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-08-13 : 10:03:46
|
| welcome!!!!!------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|