Solved

field in acces split into two fields by using space

Posted on 2008-10-23
3
160 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
Never store passwords in plain text or just their hash: it seems a no-brainier, but there are still plenty of people doing that. I present the why and how on this subject, offering my own real life solution that you can implement right away, bringin…
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…

706 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

11 Experts available now in Live!

Get 1:1 Help Now