Quantcast
Channel: MySQL Forums - Microsoft Access
Viewing all articles
Browse latest Browse all 487

Splitting a field divided by characters \ and , into 3 fields (no replies)

$
0
0
Hello, I am trying to split a column into 3 parts. here is what I have so far

SELECT Left(MODEL,InStr(1,MODEL,",")-1) AS BRAND,
Mid(MODEL,InStr(1,MODEL,"\")+1) AS LOCATION,
MID(MODEL,InStr(1,MODEL,",")+1) AS COUNTRY
FROM PRINTERS;

Which gives this result:

BRAND LOCATION COUNTRY
_LAN Other ON 0304 Blenheim Canada - PWC Retail Branch\ON 0304 Blenheim
_LAN HP SK 0697 Wynyard Canada - PWC Retail Branch\SK 0697 Wynyard

I need to drop anything after the "\" in the COUNTRY field.

How do I do this all in 1 query?

Thanks!!!!

Viewing all articles
Browse latest Browse all 487

Trending Articles