query just the first initial of a name

  • Thread starter Thread starter steve goodrich
  • Start date Start date
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
 
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]
 
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]
 
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.
 
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.
 
Back
Top