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
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.