?
Solved

how to split text in access into 2 fields

Posted on 2009-04-07
3
Medium Priority
?
744 Views
Last Modified: 2012-05-06
Hi,
I have a field like the following:
4mg/Acc
3mgkl/Mllpr
LLMN/Gkoh

So all what i want to do is that split the text into 2 fields starting the "/".  Here is the result that i would like to see:
field1               field2
4mg                 Acc
3mgkl               Mllpr
LLMN              Gkoh

Thanks.
0
Comment
Question by:karinos57
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 93

Accepted Solution

by:
Patrick Matthews earned 1000 total points
ID: 24088573
SELECT SomeField, IIf(InStr(1, SomeField, "/") > 0, Left(SomeField, InStr(1, SomeField, "/") - 1), SomeField) AS FirstPart,
    IIf(InStr(1, SomeField, "/") > 0, Mid(SomeField, InStr(1, SomeField, "/") + 1), "") AS SecondPart
FROM SomeTable
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 24088591


select Left([f1],instr([f1],"/")-1) as field1,
mid([f1],instr([f1],"/")+1) as field2
from tableX
where Instr([f1],"/")>0
0
 

Author Closing Comment

by:karinos57
ID: 31567580
this is perfect
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Suggested Courses

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question