?
Solved

how to split text in access into 2 fields

Posted on 2009-04-07
3
Medium Priority
?
748 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

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

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

Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
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 …
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…

649 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