Sort text field by 2nd word

J

JWeaver

I have a text field that contains names of workers in FName LName format. Is
there a way that I can sort this field by the Last Name (2nd word of field)
so that the records will be in alphabetical order by last name instead of by
first name? I know that the best way would be if the names were in separate
fields but this is how the database was set up some time ago.

Thanks!
 
D

Duane Hookom

You can use an expression in the Sorting and Grouping like:
=Mid([FieldName], Instr([FieldName]," ")+1)
 
J

JWeaver

Thank you. That worked beautifully!!
--
JWeaver


Duane Hookom said:
You can use an expression in the Sorting and Grouping like:
=Mid([FieldName], Instr([FieldName]," ")+1)

--
Duane Hookom
Microsoft Access MVP


JWeaver said:
I have a text field that contains names of workers in FName LName format. Is
there a way that I can sort this field by the Last Name (2nd word of field)
so that the records will be in alphabetical order by last name instead of by
first name? I know that the best way would be if the names were in separate
fields but this is how the database was set up some time ago.

Thanks!
 

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