Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Custom Sorts in a report

Status
Not open for further replies.

megmem

Instructor
Jun 20, 2002
11
US
I have an Access report that hasa date field. The Month is a field.. I have the report grouped by name. I would like to sort first by name and then by the Month field. For Example:

Name Month
Tom Oct
July
Jan


Mark Month
Feb
Jan
March

All i See in the sort box is sort AZ and DZ. Is there a custom sort like Excel. Thanks for your help in advance.

Mark
 
[smarty] The report does not have the data, your table or query has. So that is the best place for the sort. If you use a table, say tblOutput, create a query that selects all the necessary fields and add a sort to the query. In SQL the query should be something like:

Code:
SELECT * FROM tblOutput ORDER BY Name, Month;

If your month field is a number, this should work. However, I am beginning to think that the month is a text in your case. If you don't have a date field (with a date datatype I mean) at hand, you could add a monthNumber field to your query, given by

Code:
CDate('1 '& Month)

and sort on that field

Best regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top