Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / New Users / January 2008

Tip: Looking for answers? Try searching our database.

query just the first initial of a name

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
steve goodrich - 12 Jan 2008 17:46 GMT
I have a query which includes the first name and surname

I would like only the persons initial in my query, so instead of
steve goodrich I would get s goodrich

Could anyone offer any advice on how to achieve this please
Steve
fredg - 12 Jan 2008 18:00 GMT
> I have a query which includes the first name and surname
>
[quoted text clipped - 3 lines]
> Could anyone offer any advice on how to achieve this please
> Steve

It's not clear.
Do you have one field that contains both names "Steve Goodman" (not
good design), or two fields, one for the first name "Steve" and the
other for the last name "Goodman" (good design)?

If one field...
Add a new column to the query.

Initial:Left([NameField],1) & " " &
Mid([NameField],InStr([NameField]," ")+1)

If you are using 2 separate fields, then:

Initial:Left(FirstName,1) & " " & [LastName]

Signature

Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

steve goodrich - 12 Jan 2008 18:13 GMT
Hi Fred
Thanks for the quick response.
I am using 2 fields,
Where do I enter the text you suggested
thanks
Steve

>> I have a query which includes the first name and surname
>>
[quoted text clipped - 18 lines]
>
> Initial:Left(FirstName,1) & " " & [LastName]
fredg - 12 Jan 2008 18:27 GMT
> Hi Fred
> Thanks for the quick response.
[quoted text clipped - 25 lines]
>>
>> Initial:Left(FirstName,1) & " " & [LastName]

Regarding >> I have a query which includes the first name and
surname<<
As written, in your query.
Add a new column, exactly as I wrote it.
The text before the colon is what the name of the column will be. In
my example it will be [Initial].
You can name it anything else you wish, i.e.
MyName:Left(... etc)
or
SomethingElse:Left( ... etc.)

Just avoid Access reserved words, such as "Name", etc.

Signature

Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

steve goodrich - 12 Jan 2008 20:12 GMT
Thanks Fred
got it working
Steve

>> Hi Fred
>> Thanks for the quick response.
[quoted text clipped - 38 lines]
>
> Just avoid Access reserved words, such as "Name", etc.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.