Full Version: Months in Calendar Order
UtterAccess Forums > Microsoft® Access > Access Date + Time
tomfernandez
Greetings,
I have a Table that has a "Months" field (jan, feb, mar, etc.). When a query is ran off the Table, the months do not appear in calendar order, rather, ascending order.. How can I run a query that shows the months in calendar order?
Thanks in advance for your response(s)
Tommy
R. Hicks
Welcome to Utter Access Forums ... frown.gif

You need to convert the month literal to the numeric value for the month .. then sort by that instead.

RDH
tomfernandez
RDH,
How do you do that? (convert literal to numerical). Would it be as simple as: Jan=1;Feb=2;Mar=3???
R. Hicks
You need to create a field expression in your query to convert the month abbreviation to the numeric month value ...
THere is an example that should handle this:
!--c1-->
CODE
MySort: Month(CDate([months] & " 1," & Year(Date())))

RDH
tomfernandez
RDH,
Thanks for all your help!
This forum is great!!
Tommy
R. Hicks
No problem .. you are welcome .. wink.gif
DH
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.