473,671 Members | 2,370 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 2392
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,569 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
2851
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 figure out how to just get only that part number out of the line and put it in a post form. <script> var thisValue = '<%=(Recordset1.Fields.Item("LINEPart").Value)%>' arrayOfValues = thisValue.split(' ');
20
5162
by: Tom Warren | last post by:
Is there a formal name for the (Mc,Mac,O,Van...) part of a last name? Tom
3
1674
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 my friend is jim # jim leaves in NY#" In the new table (or query) I want to see: Under the field "Notes": "My name is John" Under the (new) field "Notes1": "the name of my friend is Jim"
5
2619
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. So, if the name format is: LastName, Firstname MiddleInitial Example entries are: Doe, John Doe, John P Doe, John P.
1
5052
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 with the ADSI NT Provider and only supported in the LDAP Provider. So given an UserId (UID) how can I read the First Name and Last Name using LDAP Provider. If anybody can help me with a C# sample code it would of great help. Thanks in advance.
0
1683
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 FirstName and middle initial in separate fields? string keyName = "Software\\Microsoft\\Windows NT\\CurrentVersion\\" + "Windows Messaging Subsystem\\Profiles";
1
5970
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 Data and I've got Last Name, First Name in the columns. I than have Table Full Name, with column Full Name. I have a relationship between the primary key of Table Data and the column Full Name. I have a form that displays the Full Name column. Its in...
9
16795
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 have a table where the first name and last name are in two separate fields and I want to change the table to put both fields together in a field (MEMBER). Do I do this using an update query? Thanks
2
1743
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 of patients seen and whether the test was done or not. So in my query I'm grouping by PatientID and PatientName, for my criteria I have a couple of where statements for LocationID and Date. To show if the test was done I have a field Max(.) AS...
2
2605
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 fields. I have been able to separate the field into the last and middle names but can’t figure out how to get the first name which is in between the last and middle names. All names are separated by a space. I am using the following to obtain the...
0
8472
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8909
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8819
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8596
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7428
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6222
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5690
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2806
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 we have to send another system
2
2048
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.