Month order

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

My database has fields for months and item codes. The month field is names
(Jan, Feb etc) not specific dates. From the table I will set up queries and
then reports. How do I keep the months in order in the query and therefore
the report? Ideally the query / report would be in month order and then item
code order (or any other field I choose)

Thanks, Richard
 
One way would be to have another table with twelve rows containing the month
name and the month number.

Join that table to your other table, and sort on month number, not month
name.

Alternatively, you could create a computed field in your query to give you
the month number, but I think the second table will be much more efficient.
The computed field would have to make a couple of function calls for each
row:

MonthNumber: Month(CDate("1 " & [MonthName] & " 2006"))
 
Thanks for that Doug. I just had to use 01 for Jan,02 for Feb etc for them to
keep in order. As they are standard months that we all use I thought that Ms
had put that order in Access.

Regards,
Richard

Douglas J. Steele said:
One way would be to have another table with twelve rows containing the month
name and the month number.

Join that table to your other table, and sort on month number, not month
name.

Alternatively, you could create a computed field in your query to give you
the month number, but I think the second table will be much more efficient.
The computed field would have to make a couple of function calls for each
row:

MonthNumber: Month(CDate("1 " & [MonthName] & " 2006"))

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


RichZep said:
My database has fields for months and item codes. The month field is names
(Jan, Feb etc) not specific dates. From the table I will set up queries
and
then reports. How do I keep the months in order in the query and therefore
the report? Ideally the query / report would be in month order and then
item
code order (or any other field I choose)

Thanks, Richard
 
Back
Top