By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,165 Members | 1,089 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,165 IT Pros & Developers. It's quick & easy.

Reverse display order of names

P: n/a
Hi,
I have a filed name called OwnerName where I typed in the persons first
name then surname. I now have a need to display the surmane first then
surname. Is there a way of reversing the order that the OwnerName is
displayed.
Maybe through a query or something

Thanks
Denis

Jan 16 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On 16 Jan 2007 12:10:55 -0800, Denis wrote:
Hi,

I have a filed name called OwnerName where I typed in the persons first
name then surname. I now have a need to display the surmane first then
surname. Is there a way of reversing the order that the OwnerName is
displayed.
Maybe through a query or something

Thanks
Denis
So now you have the results of incorrect database design.
The FirstName should be in a field all by itself.
Same with the LastName as well as any MiddleName/Initial.
It is very easy to put the two names together, but it can be rather
difficult to separate them.

It all depends upon how the names in the OwnerName field are entered.
If ALL of the names are in FirstName space LastName order (John Smith)
then you can use:

NewNameOrder:Mid([OwnerName],InStr([OwnerName]," ")+1) & ", " &
Left([OwnerName],InStr([OwnerName]," ")-1)

Will result in "Smith, John"

The above will fail if the [OwnerName] includes a middle name or
initial, i.e. Robert Louis Stevenson, or John J. Smith.

A wiser move would be to separate completely in your table the first
and last names.

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Jan 16 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.