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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report Date Sorting

Status
Not open for further replies.

imagranny

Technical User
Oct 17, 2002
8
0
0
US
I can not get my report to sort in the proper date order. Instead of giving me a date order, it sorts in alphabetical order by Month i.e. April, August, etc. I have checked the sortings and groupings and tried every possible combination in that area but it still does not work properly. Can anyone help?
 
I am going to assume you are basing your report off of a query...in the query, add a field to the end and put the following in the Field line:

Format([Name of date field here], "mm")

Then set this field to sort Ascending and uncheck the show box to have it hidden...

You should now have the correct order you are looking for. Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. (Albert Einstein)

Robert L. Johnson III, MCP, Network+, A+
Access Developer/Programmer
robert.l.johnson.iii@citigroup.com
 
Mstrmage1768, won't that give her what she's already getting--dates sorted alphabetically by month?

Imagranny,
It sounds to me like your query already has a Format() expression as one of its columns, and you're sorting on that. That's a mistake--you shouldn't format a date until the point where it's displayed, that is, on the form or report. If you've done it in the query because you open the query for direct viewing in other circumstances, then make a separate query without Format() for the report. Do your date formatting in the report's control.

Or did I guess wrong about your query? Rick Sprague
Want the best answers? See faq181-2886
To write a program from scratch, first create the universe. - Paraphrased from Albert Einstein
 
RickSpr,

Actually, it will not.....Format(Date(), "mm") will produce results such as 01, 02, 03 and so on....sort them ascending and you have the correct order....

I gathered that she has the dates formatted into displayed months for viewing purposes....and doesn't want to change that. By adding an additonal field to the query and using this as your sort order, she can maintain her display, but have the dates sorted correctly. Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. (Albert Einstein)

Robert L. Johnson III, MCP, Network+, A+
Access Developer/Programmer
robert.l.johnson.iii@citigroup.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top