Sort dates

G

Guate

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

Guate

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

Guate

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-
 
Top