473,513 Members | 2,559 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can you split data in 1 field (first and last name) into 2 fields (first, last)?

8 New Member
I have a field in my database with people's names. Each field has only one first name but may have more than one last name. The first name is always the first word in the field. I would like to split this field into two fields, first name and last name. Can I construct an action query to do that for me?
Feb 16 '11 #1
3 2378
Rabbit
12,516 Recognized Expert Moderator MVP
You can use InStr() to find the position of the first space and then use Mid() to retrieve the first or last name.
Feb 16 '11 #2
NeoPa
32,557 Recognized Expert Moderator MVP
That advice is absolutely correct, but as a point worth noting, names are always complicated due to their varying nature. If you have a specific rule about what goes where that is good, but be aware that such a simple rule is generally not going to cover your actual data reliably. This situation is a good example of why it's a good idea to store data elementally (See Database Normalisation and Table structures).
Feb 17 '11 #3
Mo Ewing
8 New Member
Worked perfectly. Thank you so much!
Feb 19 '11 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
2841
by: gotcha | last post by:
I need to be able to split data such as this in a line: Part A23423 Price 45.00 into just this A23423 and put that into a form field that I can post. I have the following code, but I can't...
20
5135
by: Tom Warren | last post by:
Is there a formal name for the (Mc,Mac,O,Van...) part of a last name? Tom
3
1660
by: galsaba | last post by:
I have a field called "notes". I want to seperate this field to two and more. the carachater "#" indicates the begining of a new field. For example: if "notes" is: "My name is John # the name of...
5
2614
by: LFM | last post by:
I have a table I'm importing from our SQL accounting database. The Employee Name is in one field. For the purpose of my needs, I need to extract the last name, first name and middle initial. ...
1
5034
by: Prasad Karunakaran | last post by:
I am using the C# DirectoryEntry class to retrieve the Properties of an user object in the Active Directory. I need to get the First Name and Last Name as properties. I know it is not supported...
0
1674
by: Peter | last post by:
Using CDO 1.21 how do I get First Name and Last Name from Global Address Book? I have the following code where I retrieve LastName and FirstName in one field, but how do I get LastName and...
1
5943
by: hbkiwi | last post by:
Hi, Just playing with Access fairly new to it (like days old). Also it's my first post here so if I'm in the wrong place, sorry.. What I'm wanting to know is basically I have lets call it Table...
9
16757
by: mgstlucia | last post by:
I know that I saw code on this forum to put the Last Name, First Name in the same field when you start with a table that has 2 separate fields (LASTNAME and FIRSTNAME) but I can't find it. I...
2
1733
by: dez5000 | last post by:
I have a query that is pulling a list of patients seen within a certain time frame at certain locations and it also shows whether they had a certain test done. I want to report by location the list...
2
2599
by: sfleming | last post by:
I am working with an ACCESS query that has a field called PR_EMP_NAME. This field contains an employee’s last name, first name and middle name. I need to separate this field into three separate...
0
7260
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7160
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
7099
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7525
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5685
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3233
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3222
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1594
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
456
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.