Show only First letter of first name and full last Name

Hi Experts,
How do I get the first letter of first name and full last name in query?
example,
Jane.Doe
I want to get is only JDoe.  

I only get to is the first letter is
Name: Left([UserName],1) this gave me the first letter of first name.

Thanks
jodstrr2Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

sjklein42Commented:
Try this:

LEFT([UserName],1) + SUBSTRING([UserName], CHARINDEX('.', [UserName])+1, 999)

Open in new window

0
Bill RossCommented:
Hi,

If the format of the name is Jan.Doe you need to put 2 parts together.

First initial of First Name = Left([Name],1)

Last Name is a bit more tedious.  You need to find the position of the period and get everything after that.
Instr([Name],".") will return the position of the "."
Len([Name]) will return the length of the string.
Last Name then can be computed by Right(Instr([Name],".")+1,Len([Name])-Instr([Name],"."))
Combine the 2 expressions:

Name Like You want =  Left([Name],1) & Right(Instr([Name],".")+1,Len([Name])-Instr([Name],"."))

Regards,

Bill
0
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
Example:

Left("Jon Dough",1) & Mid("Jon Dough",  InStrRev("Jon Dough"," ")+1)
Returns
JDough
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Bill RossCommented:
S/B
Name Like You want =  Left([UserName],1) & Right(Instr([UserName],".")+1,Len([UserName])-Instr([UserName],"."))

Bill
0
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
So ... generic:

Left(YourName,1) & Mid(YourName,  InStrRev(YourName," ")+1)
JDough
0
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
SELECT query:

SELECT Left([FullName],1) & Mid([FullName],InStrRev([FullName]," ")+1) AS NewName
FROM Table1
WHERE (((Table1.FullName) Is Not Null));
0
jodstrr2Author Commented:
I tried
1). sjklein42's soultion, I got the error message "Undefined function "Substring" in expression" and undefined function "CHARINDEX" in expression"

2).BillDenver's, I got the result is first Letter of first name and numbers.  for example, the result is A7, A10 etc.

3). DatabaseMX's, I got the New name as Jane.Doe
0
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
Is there always a period?

If so then:

Left("Jon.Dough",1) & Mid("Jon.Dough",  InStrRev("Jon.Dough",".")+1)
returns
JDough
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
SELECT query:

SELECT Left([FullName],1) & Mid([FullName],InStrRev([FullName],".")+1) AS NewName
FROM Table1
WHERE (((Table1.FullName) Is Not Null));
0
jodstrr2Author Commented:
Works great, thanks!!!!
0
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
Sorry for the confusion.  I swear ... I saw a Space instead of a period :-)

mx
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.