Solved

field in acces split into two fields by using space

Posted on 2008-10-23
3
163 Views
Last Modified: 2012-05-05
I have an Access database that has first name and last name in the same field

Field1
Sally Jensen
I want them to split into two in a queyr

Field1              Field2
Sally               Jensen
0
Comment
Question by:Pdeters
  • 2
3 Comments
 
LVL 82

Accepted Solution

by:
hielo earned 500 total points
ID: 22791038
try:
SELECT Left([Field],Instr([Field]," ")) as [first], Mid([Field], Instr([Field]," "), Len([Field]) ) as [last] FROM Table

Open in new window

0
 
LVL 16

Expert Comment

by:Sheils
ID: 22791041
try

select Trim(Left(Name, SpacePosition - 1)) as FirstName, Trim(Mid(Name, SpacePosition + 1)) as LastName
from tableName


0
 
LVL 82

Expert Comment

by:hielo
ID: 22796106
glad to help
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Creating and Managing Databases with phpMyAdmin in cPanel.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

943 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now