Drop Down Menu Sorting

G

Guest

How do I sort a drop down menu for selection from a database? Example... I
want the user to choose a day of the week from my access database and display
the results. Right now it's displayed in alphabetical order like this...

Fridays
Mondays
Saturdays
Sundays
Thursdays
Tuesdays
Wednesdays

Obviously I'd like to sort it by Monday to Sunday... How do I do this please?
 
J

Jens Peter Karlsen [FP-MVP]

You can add a column in your database with numbers for the days say
Monday | 1
Tuesday | 2
and so on.
That way you can order by the numbers even though you only get the
actual name of the day.
Something like this:
SELECT yourtable.weekdays FROM yourtable ORDER BY yourtable.daynumbers

Regards Jens Peter Karlsen. Microsoft MVP - Frontpage.
 
G

Guest

Ok great, thanks.

Jens Peter Karlsen said:
You can add a column in your database with numbers for the days say
Monday | 1
Tuesday | 2
and so on.
That way you can order by the numbers even though you only get the
actual name of the day.
Something like this:
SELECT yourtable.weekdays FROM yourtable ORDER BY yourtable.daynumbers

Regards Jens Peter Karlsen. Microsoft MVP - Frontpage.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top