SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 String Manipulation
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

cnbhold
Starting Member

USA
43 Posts

Posted - 11/07/2012 :  20:53:18  Show Profile  Reply with Quote
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)

Singapore
17587 Posts

Posted - 11/07/2012 :  22:40:17  Show Profile  Reply with Quote
left(<column name>, charindex(',', <column name> + ',') - 1)



KH
Time is always against us

Go to Top of Page

cnbhold
Starting Member

USA
43 Posts

Posted - 11/07/2012 :  23:31:38  Show Profile  Reply with Quote
khtan,

Thanks!!! Your code worked great!!

Angel
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000