Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Reports / Printing / March 2008

Tip: Looking for answers? Try searching our database.

Sorting Text Field with dashes

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
terryh70 - 27 Mar 2008 21:18 GMT
I have a text field that contains the following values and sort in this order

138-1
138-10
138-11
138-12
138-2
138-20
138-21
138-22
138-3
138-4

I would like to have it sort this way

138-1
138-2
138-3
138-4
138-5
138-10
138-11
138-12
138-13
138-20
138-21
138-22
fredg - 27 Mar 2008 21:50 GMT
> I have a text field that contains the following values and sort in this order
>
[quoted text clipped - 23 lines]
> 138-21
> 138-22

In the report's Sorting and Grouping dialog:
View + Sorting and Grouping
as the first Field/Expression line write:

=Val(Left([FieldName],InStr([FieldName],"-")-1))
Ascending

On the next Field/Expression line, write

=Val(Mid([FieldName],InStr([FieldName],"-")+1))
Ascending
Signature

Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.