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

Calculated field containing only the first letter of another field

Status
Not open for further replies.

Kysteratwork

Technical User
Jan 3, 2005
45
LU
Hi all,

Is it possible to create a calculated field in a table that contains part of another field:

i.e.:

Fields are: FirstName and LastName and I want to create another field which is the first letter of the FirstName, followed by a '.'

How would I do that? Do have have to create a query for that? If so, what would the SQL look like?

Thank you for any indication you can provide me with

Kysteratwork

 
Take a look at the Left function and at the & operator.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
in a query:

SELECT left(firstname, 1) & ". " & Lastname from tablename


Leslie
 
why would you want to store the same data twice in the same table?

This technically breaks normalization rules:

FirstName FirstInitial LastName
Leslie L Andrews

In a query I can always get the first initial without having to store it.

Leslie
 
I have now done it in a query and it works beautifully.

Thank you all!

Kysteratwork
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top