Gnub Posted May 13, 2007 Share Posted May 13, 2007 I've got a problem i need help solving. I have a field that holds information on cities. Some of the data however comes with additional information in a '( )'. I dont want what's inside these brackets, however i cannot ignore it while scraping. So...it has to be done through the SQL. I've been lead to a few functions called: LEFT(), RIGHT(), CHARINDEX(), SUBSTRING(). What im thinking is that i grab the position of the first '(' and then get all that's before it, and put that into a seperate collumn, when i eventually export this info into a csv. My question is, will these functions help me achieve my goal? thanks in adv. Gnub. Quote Link to comment https://forums.phpfreaks.com/topic/51166-solved-help-with-string-function/ Share on other sites More sharing options...
Gnub Posted May 13, 2007 Author Share Posted May 13, 2007 LEFT(Field, CHARINDEX(string1, Field)) AS newField Just incase someone wanted to know my solution. String1 = what you are looking for. Field = the field your searching in. newField = the name of the new field that holds the changed data. Quote Link to comment https://forums.phpfreaks.com/topic/51166-solved-help-with-string-function/#findComment-251963 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.