Sort dates

G

Guest

I have a field for DOB (mm/dd/yyyy); when I ask that they be sorted in
ascending order, the query sorts them by year. How can I sort them by month
and day instead, so that the birthdates come out in chronological order for
each month?
 
D

Dirk Goldgar

Guate said:
I have a field for DOB (mm/dd/yyyy); when I ask that they be sorted in
ascending order, the query sorts them by year. How can I sort them
by month and day instead, so that the birthdates come out in
chronological order for each month?

ORDER BY Month(DOB), Day(DOB)
 
G

Guest

Dirk, I tried your suggestion but I must be doing something wrong.... Can
you provide more detail? Thanks much-
 
G

Guest

Thanks, Arvin. I had to play around with it a bit in design view, but
finally got it. For us novice types, it's perhaps easier to explain these
things in design view, then we can look to see what it looks like in SQL
view! The problem I was running in to was that I already had a sorted field
in my query, so I wasn't sure where to place the new SQL statement and kept
getting error messages. Thanks much for your help! Guate

Arvin Meyer said:
The SQL view of the query should look just like this (using your field and
tablenames):

Select * From TableName
Order By Month([DOB]), Day([DOB]);
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access


Guate said:
Dirk, I tried your suggestion but I must be doing something wrong.... Can
you provide more detail? Thanks much-
 

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