A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Sort text field by 2nd word



 
 
Thread Tools Display Modes
  #1  
Old July 30th, 2009, 03:15 PM posted to microsoft.public.access.reports
JWeaver
external usenet poster
 
Posts: 90
Default 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  
Old July 30th, 2009, 03:20 PM posted to microsoft.public.access.reports
Duane Hookom
external usenet poster
 
Posts: 7,177
Default 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  
Old July 30th, 2009, 03:46 PM posted to microsoft.public.access.reports
JWeaver
external usenet poster
 
Posts: 90
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:50 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.