Format Name

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a database that imports emails from Outlook. When I get the data into
a table, the names are not formatted correctly. Ex. jane doe or JANE DOE. I
ran a query to use in a report, but I want to fix the format of the name.
Need for it to be as Jane Doe (first and last name capitalized). Is there an
expression I can include in my query to do this for me?

Thanks
 
I have a database that imports emails from Outlook. When I get the data into
a table, the names are not formatted correctly. Ex. jane doe or JANE DOE. I
ran a query to use in a report, but I want to fix the format of the name.
Need for it to be as Jane Doe (first and last name capitalized). Is there an
expression I can include in my query to do this for me?

Thanks

For data already stored in a table, you can run an Update query:

Update YourTable Set YourTable.[FieldName] = StrConv([FieldName],3);

Note: this will incorrectly capitalize some words which should contain
more than one capital, i.e. O'Brien, MacDonald, IBM, Jones-Smith, ABC,
etc., and incorrectly capitalize some words that should not have any
capitals, or whose capitaliztion depends upon usage, such as e. e.
cummings, abc, van den Steen.

Then some names can be capitalized in more than one manner, depending
upon personal preference, i.e. O'Connor and O'connor, McDaniels and
Mcdaniels, etc. are both correct.

You can create a table of exceptions and have the code use DLookUp
with a message if one of the exception words is found to allow the
user to not change that record.
 
Check out StrConv function in Help file.... but note that it will not
properly change MACDONALD into MacDonald, for example.
 
Back
Top