If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Sort text field by 2nd word
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! -- JWeaver |
#2
|
|||
|
|||
Sort text field by 2nd word
You can use an expression in the Sorting and Grouping like:
=Mid([FieldName], Instr([FieldName]," ")+1) -- Duane Hookom Microsoft Access MVP "JWeaver" wrote: 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! -- JWeaver |
#3
|
|||
|
|||
Sort text field by 2nd word
Thank you. That worked beautifully!!
-- JWeaver "Duane Hookom" wrote: You can use an expression in the Sorting and Grouping like: =Mid([FieldName], Instr([FieldName]," ")+1) -- Duane Hookom Microsoft Access MVP "JWeaver" wrote: 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! -- JWeaver |
Thread Tools | |
Display Modes | |
|
|