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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how modify field so that only part of text string appears

Status
Not open for further replies.

leeroi

Technical User
Jun 5, 2000
122
US
I have a query that display clients first and last names in two separate fields. I want to modify it so that it displays only the first letter of the first name in the FirstName field.

How can I do this?

Thanks
 
Likewise, you can use the RIGHT function to select characters on the right side of your string. This obviously dosen't apply to your situation, but still good to know.

Left(field name or string,#)
Right(field name or string,#)

# equals the number of characters you want to see. So if you want the last 3 characters of a model number for example...

Code:
SELECT Right([ModelNum],3) FROM tblComponents

Hope this helps!
PJ
 
and if you want something in the middle, it's MID:

MID(FieldName, WhereToStart, HowFarToGo)

MID("Programmer", 3, 5) would return:

ogram



Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual

Essential reading for anyone working with databases:
The Fundamentals of Relational Database Design
Understanding SQL Joi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top