Sort months of year to run monthly

B

Brian Waight

I am new to access, and I am using access 2000
I need to sort data by month January to December not Assending
alphabetically, any suggestions.
Thanks for any help given Brian
 
D

Douglas J. Steele

If you've got Dates (i.e.: you're using a date field, not a text field), you
can add a computed field to your query to give you the month number, and
sort by it. Something like: MonthNb: Month([MyDateField])

Otherwise, you can use the same technique that you use to force a sort
order. Create a table that has 2 columns: MonthNm (a text field) and SortNb
(a numeric field). Store the 12 month names in it (1 row per), and set the
SortNb order to the correct value: January is 1, February is 2 and so on.
Join that table to your other query, and sort by SortNb.
 
B

Brian

Thanks for help works fine

Douglas J. Steele said:
If you've got Dates (i.e.: you're using a date field, not a text field), you
can add a computed field to your query to give you the month number, and
sort by it. Something like: MonthNb: Month([MyDateField])

Otherwise, you can use the same technique that you use to force a sort
order. Create a table that has 2 columns: MonthNm (a text field) and SortNb
(a numeric field). Store the 12 month names in it (1 row per), and set the
SortNb order to the correct value: January is 1, February is 2 and so on.
Join that table to your other query, and sort by SortNb.

--
Doug Steele, Microsoft Access MVP

(No private e-mails, please)



Brian Waight said:
I am new to access, and I am using access 2000
I need to sort data by month January to December not Assending
alphabetically, any suggestions.
Thanks for any help given Brian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top