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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 String Manipulation

Author  Topic 

cnbhold
Starting Member

43 Posts

Posted - 2012-11-07 : 20:53:18
I need a way to only select the characters before the comma which are not the same length.

Example

Russell,123456
Cranford,6575647
Wells,9878676

Desired Results

Russell
Cranford
Wells

Angel

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2012-11-07 : 22:40:17
[code]left(<column name>, charindex(',', <column name> + ',') - 1)[/code]


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

cnbhold
Starting Member

43 Posts

Posted - 2012-11-07 : 23:31:38
khtan,

Thanks!!! Your code worked great!!

Angel
Go to Top of Page
   

- Advertisement -