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 problem

Author  Topic 

pmccann1
Posting Yak Master

107 Posts

Posted - 2007-05-03 : 09:50:26
I need to read a certain piece of a string
here is a few smaples of the rows

cjud |Armagh|3/15/2006 1:59:10 PM|||
KCOL |Armagh|11/20/2006 11:36:39 AM|||
PQUG |Armagh|3/1/2006 3:51:17 PM|||

i need to remove just the date but as you can see although it starts in the same place the end character is different so substring or left function does not return the right stuff

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-05-03 : 09:52:48
You could play around with the CHARINDEX function or the PATINDEX function.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-05-03 : 10:29:49
http://weblogs.sqlteam.com/mladenp/archive/0001/01/01/7421.aspx
point 8

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
Go to Top of Page
   

- Advertisement -