Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Concatenate parts of two fields

Status
Not open for further replies.

haneen97

Programmer
Dec 10, 2002
280
US
Hi,

Trying to concatenate the first letter of the first name and the first 7 letters of the last name to create a user naem. I am using the Mid$ function and getting a syntax error.

SELECT UPPER(Mid$((First_Name,1,1) & "" & (Last_Name,1,7))) FROM users AS User_Name;

Please help

Thanks a lot.

Mo
 
Hi,
I think you want to use the "Left" function, as in this:

SELECT UPPER(Left(First_Name,1) & "" & Left(Last_Name,7)) FROM users AS User_Name;

Note that we needed to use two "left" functions. HTH, [pc2]
Randy Smith
California Teachers Association
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top