name query

iso96

Registered User.
Local time
Today, 05:12
Joined
Mar 21, 2005
Messages
10
Hello,

i have a table with a field containing peoples 'names' for example - David Moore is there anyway of doing a query on this so it lists the contents in order of the surname.

Thanks for your time


iso
 
Hi
Something like this in your query :

Surname: Right([MyFieldName],Len([MyFieldName])-InStr([MyFieldName]," "))

will extract all of the data after the first space. You can then sort on that. Be aware that if an entry has a name such as "Mary Anne Smith" then it will pick up "Anne Smith" instead of Smith.

Remember to use your actual field name.

HTH, Andrew
 
Yes! You should not have a name consisting of two parts first name, surname this is considered poor practice and contravenes one of the design rules for databases. You should put atomic data in separate fields then you would not have this problem!
 
thanks guys,

decided to seperate them.
 

Users who are viewing this thread

Back
Top Bottom