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

Sort Month Names in correct order

Status
Not open for further replies.

Zonie32

Technical User
Jan 13, 2004
242
US
I have a report where I formatted the date field of the query to mmmyyyy. Now in my report I want to group by the date Jan2004 - Dec2004, however it wants to sort this alphabetically rather than sequentially. ie, April comes first, then August because they begin with "A".
Any way to fix this problem?
 
In the first blank column of the query, for the Field line put:

=Month([nameofdatefield])

and sort this ascending....

=======================================
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. (Calvin from Calvin And Hobbs)

Robert L. Johnson III
MCSA, CNA, Net+, A+
w: rljohnso@stewart.com
h: wildmage@tampabay.rr.com
 
Thank you for the reply. I entered in the criteria you provided, but it prompts me for a parameter.
This query is a parameter query where I have under field name PHIUDate, to find Between [BeginPHIUDt] and [EndPHIUDt]. These dates are formatted like 2/1/2004.
I want them as Feb2004, Mar2004, etc.

So, I made another field called PHIUMth: Format([PHIU],"mmmyyyy"). Then I added your =Month([PHIUMth])in the blank column and it makes it an Expr1 and prompts me to enter PHIUMth and then BeginPHIUDt and EndPHIUDt. I'm not sure this is working properly. Maybe I am not understanding how to do it. Your help is appreciated.
 
Zonie,

Put whatever fieldname (from the source table) the date is being stored in into the Month(FieldName]) box. It sounds like your date field in the table is PHIUDate. Is that correct? If so, just enter Month([PHIUDate]) and it should work.

Do the formating for how your want your month to look in a separate field in the query. So the Month() function is a separate field and sort by that. If you don't want it to show up in the query dataset, deselect the "show" check box.

Sounds like you might be confusing the functions by trying to group them together. Just create a new field with the Month funciton and sort by it, and it should all come together.

-Patrick

Nine times out of ten, the simplest solution is the best one.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top