query just the first initial of a name

S

steve goodrich

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
 
F

fredg

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

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]
 
S

steve goodrich

Hi Fred
Thanks for the quick response.
I am using 2 fields,
Where do I enter the text you suggested
thanks
Steve
fredg said:
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

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]
 
F

fredg

Hi Fred
Thanks for the quick response.
I am using 2 fields,
Where do I enter the text you suggested
thanks
Steve
fredg said:
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

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]



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.
 
S

steve goodrich

Thanks Fred
got it working
Steve
fredg said:
Hi Fred
Thanks for the quick response.
I am using 2 fields,
Where do I enter the text you suggested
thanks
Steve
fredg said:
On Sat, 12 Jan 2008 17:46:03 -0000, steve goodrich wrote:

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

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]



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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top