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

Sorting Months in a report

Status
Not open for further replies.

migrani

Programmer
Feb 17, 2005
4
US
I have the Month as a field in my table, is there a way of sorting the field by the order of the month....Jan..Feb until Dec?
 
Hi Migrani:
I assume that you already have a report. If so, in the view mode,
Click on view >Sorting and Grouping
and In the field/Expression select month
and in the Sort order select ascending
and try to get creative by adding a header and/or footer if you want by changing the grouping properties to YES. Its default to No if you don't have a month header and/or footer and it should sort your report by month

If you haven't created a report yet:
When you run Report Wizard to the question What sort order do you want for your records?
Use the drop down arrow and select the month field. Its already set to ascending order.
Hope this helps
Paul
 
Thanks Paul, that was exactly what I tried but the sorting gave me .....August, April...not January, February..etc
 
Why are you storing the month in a text field? You should be using a numeric field so that your value will be 1 for January, 2 for February,...

If you want to display a text value, you can use an expression like:
=DateSerial(2000, [MonthField],1)
and set the format to "mmmm"

I wouldn't go too much further until you either convert the field to a number or use an expression or function to convert the text to a number. One expression that would sort in the Sorting and Grouping dialog is:
=Instr(Left([TextMthField],3), "JanFebMarApr...")


Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Thanks to dhookom, you gave me 2 great answers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top