By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,566 Members | 1,659 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,566 IT Pros & Developers. It's quick & easy.

MS Access Table Query showing Customer Name as a code.

P: 4
HI,
I would like to show the 1st 5 characters of Customers First and Last Name combined into one field.
Eg John Snow = SnowJ
Thanks in advance.
Jun 19 '15 #1

✓ answered by Seth Schrock

You would use the Left() function on the combined texts.
Expand|Select|Wrap|Line Numbers
  1. Left(LastName & FirstName, 5) As CustomerCode

Share this Question
Share on Google+
3 Replies


Seth Schrock
Expert 2.5K+
P: 2,951
You would use the Left() function on the combined texts.
Expand|Select|Wrap|Line Numbers
  1. Left(LastName & FirstName, 5) As CustomerCode
Jun 19 '15 #2

P: 4
Hey Seth,
Thank you for the response.
Something so simple hahhaha.
Regards
Jun 19 '15 #3

zmbd
Expert Mod 5K+
P: 5,397
Something to consider...
My last name has more than five characters....
So if you take my first name (Zmbd) and then my last name (Babcdefgh) use the above left function you get Babcd not a BabcdZ or BabcZ etc...

Is this truly what you want?

Expand|Select|Wrap|Line Numbers
  1. Left([Lastname],4) & Left([FirstName,1) As CustomerCode
Would return the BabcZ

Have you considered how to handle the case of the shorter last/sur-names as one might find for someone born in Korea, Japan, China, etc?
Jun 24 '15 #4

Post your reply

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