Separating Field Into 2 Fields At A Character

  • Thread starter Thread starter Craig
  • Start date Start date
C

Craig

I have a field called keyword/modifier...the field may
have records that look like the following:

pipe,black steel
shoe, brown leather
somethingelse, anotherword

i want to separate this column into 2 columns at the
comma. since the comma is in varying places each time, I
can't just use a left, right, or mid function alone. Can
someone let me know how to write a query that will do this?

Help appreciated...thank you...Craig
 
Dear Craig:

You can use the InStr function to locate the comma, then use the value
returned by this function in the Left and SubStr functions to split
the string.

Be aware that if there is more than one comma in the string, it will
likely split at the first one, depending on how you write the code.

Tom Ellison
Microsoft Access MVP
Ellison Enterprises - Your One Stop IT Experts
 
Back
Top