Months of the year in chronological order

Months in chronological order

Hello Ken

Answer to your question is a resounding - YES!!!

Regards
Terence
 
Then at this stage, the best way I can figure out to do this is to create a seprate table that only has two flds; the month, where the spelling is just like the spelling in the main table. Make this the pk. And the second fld would be the associated numerical value for each month.

Now when you do the recordsource for your report, link, on the month flds and bring in the numerical fld from the second table, along with what ever flds you need.

Finally, sort on this fld in the report and you should be set...

But... I suspect all this could have been avoided if you'd set the date flds up using some of Pat's pointers...
 
Months in chronological order

Gentleman

I have decided to get of my arse and do something myself, based I hope on your suggestions. I have changed the following:

I have added a numberic field to my tblMONTHS. There are two fields now:

Number and Month I have enter 1 next to January, 2 next to February etc. I have also indexed the number field (is this OK?)

I have then changed everything related to the combo boxes using the tblMONTHS.

I now get a query that shows the number but still cannot get them in the correct order 1,2,3, etc.

Included are three screen shots, which I have had to zip as they would go over the 100kb limit.

The first screenshot shows the new tblMONTHS
The second screenshot shows the setup for the combo box, which is working fine. I can see only the months of the year, the numbers are hidden.

The third screenshot shows the result of a query. In the report, I have used the IIF function to change 1 January:

=IIF([CMONTH]=1,"January",IIF([CMONTH]=2,"February" etc, and this works fine. But I still cannot get the months to flow from January to December.

Where am I going wrong now?

Regards
Terence
 
Months in chronological order

Gentleman

I have decided to get of my arse and do something myself, based I hope on your suggestions. I have changed the following:

I have added a numberic field to my tblMONTHS. There are two fields now:

Number and Month I have enter 1 next to January, 2 next to February etc. I have also indexed the number field (is this OK?)

I have then changed everything related to the combo boxes using the tblMONTHS.

I now get a query that shows the number but still cannot get them in the correct order 1,2,3, etc.

Included are three screen shots, which I have had to zip as they would go over the 100kb limit.

The first screenshot shows the new tblMONTHS
The second screenshot shows the setup for the combo box, which is working fine. I can see only the months of the year, the numbers are hidden.

The third screenshot shows the result of a query. In the report, I have used the IIF function to change 1 January:

=IIF([CMONTH]=1,"January",IIF([CMONTH]=2,"February" etc, and this works fine. But I still cannot get the months to flow from January to December.

Where am I going wrong now?

Regards
Terence
 
Months in chronological order

Gentleman

I have decided to get of my arse and do something myself, based I hope on your suggestions. I have changed the following:

I have added a numberic field to my tblMONTHS. There are two fields now:

Number and Month I have enter 1 next to January, 2 next to February etc. I have also indexed the number field (is this OK?)

I have then changed everything related to the combo boxes using the tblMONTHS.

I now get a query that shows the number but still cannot get them in the correct order 1,2,3, etc.

Included are three screen shots, which I have had to zip as they would go over the 100kb limit.

The first screenshot shows the new tblMONTHS
The second screenshot shows the setup for the combo box, which is working fine. I can see only the months of the year, the numbers are hidden.

The third screenshot shows the result of a query. In the report, I have used the IIF function to change 1 January:

=IIF([CMONTH]=1,"January",IIF([CMONTH]=2,"February" etc, and this works fine. But I still cannot get the months to flow from January to December.

Where am I going wrong now?

Regards
Terence
 

Attachments

Months in chronological order

Gentleman

I have decided to get of my arse and do something myself, based I hope on your suggestions. I have changed the following:

I have added a numberic field to my tblMONTHS. There are two fields now:

Number and Month I have enter 1 next to January, 2 next to February etc. I have also indexed the number field (is this OK?)

I have then changed everything related to the combo boxes using the tblMONTHS.

I now get a query that shows the number but still cannot get them in the correct order 1,2,3, etc.

Included are three screen shots, which I have had to zip as they would go over the 100kb limit.

The first screenshot shows the new tblMONTHS
The second screenshot shows the setup for the combo box, which is working fine. I can see only the months of the year, the numbers are hidden.

The third screenshot shows the result of a query. In the report, I have used the IIF function to change 1 January:

=IIF([CMONTH]=1,"January",IIF([CMONTH]=2,"February" etc, and this works fine. But I still cannot get the months to flow from January to December.

Where am I going wrong now?

Regards
Terence
 
Months in chronological order

Gentleman

I have decided to get of my arse and do something myself, based I hope on your suggestions. I have changed the following:

I have added a numberic field to my tblMONTHS. There are two fields now:

Number and Month I have enter 1 next to January, 2 next to February etc. I have also indexed the number field (is this OK?)

I have then changed everything related to the combo boxes using the tblMONTHS.

I now get a query that shows the number but still cannot get them in the correct order 1,2,3, etc.

Included are three screen shots, which I have had to zip as they would go over the 100kb limit.

The first screenshot shows the new tblMONTHS
The second screenshot shows the setup for the combo box, which is working fine. I can see only the months of the year, the numbers are hidden.

The third screenshot shows the result of a query. In the report, I have used the IIF function to change 1 January:

=IIF([CMONTH]=1,"January",IIF([CMONTH]=2,"February" etc, and this works fine. But I still cannot get the months to flow from January to December.

Where am I going wrong now?

Regards
Terence
 

Attachments

Last edited:
Looks like the number is being stored as a text string. Hint: It appears to aligning to the left in the third .jpg :)
 
My apologies for all the same entries, no idea what happened there. I am including a screenshot of the report. I have included the numbers relating to the months.

Regards
Terence
 

Attachments

  • FORMS055.JPG
    FORMS055.JPG
    52.6 KB · Views: 140
Months in chronological order

Hello Wayne & Pat

SUCCESS!!!

The mistake I made was to assign a 1 to January ending up with a 12 for December. I assumed that I could enter a 01 for sorting but of course you can't.

I simply changed the numbers from 10 to 21 and can now sort correctly.

I cannot thank you both enough for getting me more involved in Access , my forte is Corel Ventura V10 and Adobe, but now I am an Access fan.

Please see the final screenshot showing all the months in their correct chronological order - at last, thank god. I am going to have a swim in the Indian Ocean now (I'm thirty yards away from the ocean).

Sincere regards
Terence (who will definitely come back to you for further advice later)
Mombasa
 

Attachments

  • FORMS056.JPG
    FORMS056.JPG
    51.7 KB · Views: 132
Months in chronological ordert

Hello Ken

I'm very sorry I didn't acknowledge you efforts on my behalf. Many thanks

Regards
Terence
 
Just messing with you - Glad you got working :)
 
I simply changed the numbers from 10 to 21 and can now sort correctlyI simply changed the numbers from 10 to 21 and can now sort correctly
The problem was caused because you had defined the numbers as text fields. Text fields are left justified and therefore sort differently than numeric fields which are right justified.
 

Users who are viewing this thread

Back
Top Bottom