Solved

field in acces split into two fields by using space

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
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…

809 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