Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parsing a Value in an Update Qry 1

Status
Not open for further replies.

Jean9

Programmer
Dec 6, 2004
128
US
I would like to use an update query to parse a string contained in one column that is delimited by commas into three separate columns. What code might one use on the Update To lines of the query?
 
A starting point (SQL code):
UPDATE yourTable
SET newCol1 = Trim(Left(oldColumn,InStr(oldColumn,',')-1))
, newCol2 = Mid(Left(oldColumn,InStrRev(oldColumn,',')-1),1+InStr(oldColumn,','))
, newCol3 = Mid(oldColumn,InStrRev(oldColumn,',')+1)
WHERE oldColumn Like '*,*,*'

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top