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
-
Nvidia just fixed an AMD Linux bug
by
Alex5723
12 hours, 27 minutes ago -
50 years and counting
by
Susan Bradley
14 hours, 47 minutes ago -
Fix Bluetooth Device Failed to Delete in Windows Settings
by
Drcard:))
3 minutes ago -
Licensing and pricing updates for on-premises server products coming July 2025
by
Alex5723
23 hours, 31 minutes ago -
Edge : Deprecating window.external.getHostEnvironmentValue()
by
Alex5723
23 hours, 36 minutes ago -
Rethinking Extension Data Consent: Clarity, Consistency, and Control
by
Alex5723
23 hours, 40 minutes ago -
OneNote and MS Word 365
by
CWBillow
1 day, 1 hour ago -
Ultimate Mac Buyers Guide 2025: Which Mac is Right For You?
by
Alex5723
1 day, 1 hour ago -
Intel Unison support ends on Windows 11 in June
by
Alex5723
1 day, 1 hour ago -
April 2025 — still issues with AMD + 24H2
by
Kevin Jones
1 day, 2 hours ago -
Windows 11 Insider Preview build 26200.5518 released to DEV
by
joep517
1 day, 13 hours ago -
Windows 11 Insider Preview build 26120.3671 (24H2) released to BETA
by
joep517
1 day, 13 hours ago -
Forcing(or trying to) save Local Documents to OneDrive
by
PateWilliam
1 day, 22 hours ago -
Hotpatch for Windows client now available (Enterprise)
by
Alex5723
1 day, 10 hours ago -
MS-DEFCON 2: Seven months and counting
by
Susan Bradley
11 hours, 23 minutes ago -
My 3 monitors go black & then the Taskbar is moved to center monitor
by
saturn2233
2 days, 7 hours ago -
Apple backports fixes
by
Susan Bradley
1 day, 13 hours ago -
Win 11 24H2 will not install
by
Michael1950
11 hours, 36 minutes ago -
Advice to convert MBR to GPT and install Windows 11 Pro on unsupported PC
by
Andy M
7 hours, 18 minutes ago -
Photos from iPhone to Win 10 duplicating/reformatting to .mov
by
J9438
20 hours, 5 minutes ago -
Thunderbird in trouble. Here comes Thundermail
by
Alex5723
2 days, 9 hours ago -
Get back ” Open With” in context menus
by
CWBillow
2 days, 22 hours ago -
Many AMD Ryzen 9800X3D on ASRock have died
by
Alex5723
1 day, 14 hours ago -
simple general stupid question
by
WSaltamirano
2 days, 20 hours ago -
April 2025 Office non-Security updates
by
PKCano
3 days, 13 hours ago -
Microsoft wants to hear from you
by
Will Fastie
1 day, 4 hours ago -
Windows 11 Insider Preview Build 22635.5160 (23H2) released to BETA
by
joep517
3 days, 16 hours ago -
Europe Seeks Alternatives to U.S. Cloud Providers
by
Alex5723
3 days, 22 hours ago -
Test post
by
Susan Bradley
4 days ago -
Used Systems to delete Temp files Gone WRONG what does this mean?
by
Deo
4 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.