Months in date order on query

jamphan

Registered User.
Local time
Today, 01:13
Joined
Dec 28, 2004
Messages
143
I have a combo box that contains the months. They appear in month order on the form but when I query, they are in alphabetical. How can I get this to be in month order on the query?
 
Can you make them actual dates so they will list in the right order and then choose the format to display in a different way ie. mmm yy for Feb 05.
 
No because I have another cbo with the year.
 
You could still make them dates like 1/1/2005, 2/1/2005 but just masked them as months and leave the date off the view.
 
What happens if the year needs to be 2004 or 2006?
 
it doesn't matter what the year is for the display mask. Are you joining the month with the year from your other cbo?
 
What would the display mask look like? I have the month and year as 2 seperate fields on the table and query but coincide with one another as far as entry goes.
 
You would use mmm...for as many spaces as you want to display ie. mmm for Feb, Mar etc...
If you are bringing the year and month together at another point this should work fine. Just ignore the date field in the month/date you are creating to display month only.
 
That works well until it hits my table because it is trying to store it as text for some reason and gives an error message that incorrect values are trying to be input. I have both my main table and cbo table month fields set to date/time format with mmmm as the format. Any ideas on why this is happeneing?
 
You would need to store them as dates. This would fix the problem.
 
I need the cbo to show them as Months and also the query needs to show them as months.
 
Yes. That's not a problem as I outlined above. Even if you make them dates in the table you can just display any part of that date in the cbos.
 
Sorry for so many questions but it is getting there. It will now accept my dates but when it appears in the cbo it is in date format then once selected changes to the month. Is there a way to get it to appear as months before it is selected?
 

Users who are viewing this thread

Back
Top Bottom