Click here to Skip to main content
15,912,578 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
column has a values, that values has a ':' in between i need all the info left side of that ':'
Posted

1 solution

Try:
SQL
SELECT SUBSTRING(myColumn, 0, CHARINDEX(':', myColumn)) FROM MyTable
 
Share this answer
 
Comments
kanna6963 24-Oct-13 5:39am    
For the same ques i need right side
OriginalGriff 24-Oct-13 5:44am    
So, move the CHARINDEX to the "start index" position of the SUBSTRING, where the zero is, and replace it with the length of the string (or 9999, whichever you prefer) as the second parameter.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900