I’m using Access 2000 with Win 2000. I need to create a unique identifier from several fields in a table. Fields are Name and Customer Number. Example: Name=Smith,Mary (no spaces between comma and first name) and Customer Number=551077. I need the unique identifier to be SmiM551077 – first three letters of last name plus first initial plus customer number. If anyone can help or send me to a thread for this problem, I would be most appreciative.
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Extracting Info from String (Access 2000)
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Extracting Info from String (Access 2000)
- This topic has 4 replies, 3 voices, and was last updated 21 years, 10 months ago.
AuthorTopicWSAHuffman
AskWoody LoungerMay 27, 2003 at 2:16 pm #388116Viewing 0 reply threadsAuthorReplies-
WSHansV
AskWoody LoungerMay 27, 2003 at 2:38 pm #680060You can do this in a query. In an emppty column, enter the following expression in the Field: row:
UniqueID: Left([Name],3)&[Customer Number]
The Left function extracts the first three characters of the name and & is the concatenation operator that combines strings.
Notes:
1. If someone has a last name of less than 3 characters, the comma from the name will be included in the new field.
2. If you want a really unique identifier, use an AutoNumber field. It provides an ID number that is guaranteed to be unique within a table. -
WSAHuffman
AskWoody LoungerMay 27, 2003 at 2:53 pm #680063My problem is getting the first initial of the first name. Both first and last names are in the same field and are separated by a comma. Example: Hollingsworth,Cecil. What I need to do is get HolC – that is the first three letters of the last name AND the first initial of the first name. I need the first letter past the comma and cannot figure out how to get it.
-
WSHansV
AskWoody LoungerMay 27, 2003 at 3:24 pm #680071I’m sorry, I didn’t read your original post closely enough. You can use the InStr function to get the position of the comma in the name field, and the Mid function to extract the first initial.
InStr([Name],”,”) returns the position of the comma, for example if Name = “Jones,Jim”, InStr(Name,”,”) = 6.
InStr([Name],”,”)+1 returns the position of the first character past the comma, i.e. the first initial.
Mid([Name],InStr([Name],”,”)+1,1) returns a string of length 1 from Name starting at the position past the comma, i.e. it returns the first initial.So the expression becomes:
UniqueID: Left([Name],3)&Mid([Name],Instr([Name],”,”)+1,1)&[Customer Number]
-
WSBrentD
AskWoody LoungerMay 27, 2003 at 3:31 pm #680072(Edited by BrentD on 27-May-03 11:31. Looks like Hans beat me to the punch, but I’ll leave this up here anyhow.
)
This should work for you: Left([Name],3) & Mid([Name],InStr([Name],”,”)+1,1) & [Customer Numer]
What it’s doing is finding the position of the comma using the InStr function, adding 1 to that number and then selecting the one character at that position using the Mid function.
-
-
Viewing 0 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
WU help needed with “Some settings are managed by your organization”
by
Peobody
1 hour, 39 minutes ago -
No Newsletters since 27 January
by
rog7
5 hours, 48 minutes ago -
Linux Mint Debian Edition 7 gets OEM support, death of Ubuntu-based Mint ?
by
Alex5723
6 hours, 9 minutes ago -
Windows Update “Areca Technology Corporation – System – 6.20.0.41”
by
Bruce
58 minutes ago -
Google One Storage Questions
by
LHiggins
8 hours, 29 minutes ago -
Button Missing for Automatic Apps Updates
by
pmcjr6142
3 hours, 45 minutes ago -
Ancient SSD thinks it’s new
by
WSila
44 minutes ago -
Washington State lab testing provider exposed health data of 1.6 million people
by
Nibbled To Death By Ducks
16 hours, 28 minutes ago -
WinRE KB5057589 fake out
by
Susan Bradley
9 hours, 47 minutes ago -
The April 2025 Windows RE update might show as unsuccessful in Windows Update
by
Susan Bradley
26 minutes ago -
Firefox 137
by
Charlie
27 minutes ago -
Whisky, a popular Wine frontend for Mac gamers, is no more
by
Alex5723
1 day, 4 hours ago -
Windows 11 Insider Preview build 26120.3863 (24H2) released to BETA
by
joep517
1 day, 5 hours ago -
Windows 11 Insider Preview build 26200.5551 released to DEV
by
joep517
1 day, 5 hours ago -
New Windows 11 PC setup — can I start over in the middle to set up a local id?
by
ctRanger
55 minutes ago -
Windows 11 Insider Preview Build 26100.3902 (24H2) released to Release Preview
by
joep517
1 day, 8 hours ago -
Oracle kinda-sorta tells customers it was pwned
by
Nibbled To Death By Ducks
1 day, 14 hours ago -
Global data centers (AI) are driving a big increase in electricity demand
by
Kathy Stevens
2 days ago -
Office apps read-only for family members
by
b
2 days, 3 hours ago -
Defunct domain for Microsoft account
by
CWBillow
2 days ago -
24H2??
by
CWBillow
48 minutes ago -
W11 23H2 April Updates threw ‘class not registered’
by
WindowsPersister
1 day, 8 hours ago -
Master patch listing for April 8th, 2025
by
Susan Bradley
38 minutes ago -
TotalAV safety warning popup
by
Theodore Nicholson
23 hours, 53 minutes ago -
two pages side by side land scape
by
marc
4 days, 1 hour ago -
Deleting obsolete OneNote notebooks
by
afillat
4 days, 3 hours ago -
Word/Outlook 2024 vs Dragon Professional 16
by
Kathy Stevens
3 days, 6 hours ago -
Security Essentials or Defender?
by
MalcolmP
3 days, 9 hours ago -
April 2025 updates out
by
Susan Bradley
6 hours, 34 minutes ago -
Framework to stop selling some PCs in the US due to new tariffs
by
Alex5723
3 days, 2 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.