Sort By Date and Month Only

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

On my report I have Name and Birthdate. The info comes from a query and what
I am trying to do is sort the birth dates by date only ( it's already sorted
by month ). The info it gets from the query is date - month - year. I don't
want to display their birth year so I entered dd/mmmm in the birthdate field
but it still sorts by year.

Thanks - George
 
Simple solution, if you do not need to wrap past the end of a year:
ORDER BY Format([BirthDate], "mmdd")
 
Where does this expression get entered - in the birthdate field in the report
or the query?

Thanks

Allen Browne said:
Simple solution, if you do not need to wrap past the end of a year:
ORDER BY Format([BirthDate], "mmdd")

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

George said:
On my report I have Name and Birthdate. The info comes from a query and
what
I am trying to do is sort the birth dates by date only ( it's already
sorted
by month ). The info it gets from the query is date - month - year. I
don't
want to display their birth year so I entered dd/mmmm in the birthdate
field
but it still sorts by year.

Thanks - George
 
In query design view, you can type this into a fresh column of the Field
row:
Format([BirthDate], "mmdd")
Then choose Ascending in the Sorting row under this.

(If you switch the query to SQL View (View menu), you will see how Access
turns this into the ORDER BY clause.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

George said:
Where does this expression get entered - in the birthdate field in the
report
or the query?

Thanks

Allen Browne said:
Simple solution, if you do not need to wrap past the end of a year:
ORDER BY Format([BirthDate], "mmdd")


George said:
On my report I have Name and Birthdate. The info comes from a query and
what
I am trying to do is sort the birth dates by date only ( it's already
sorted
by month ). The info it gets from the query is date - month - year. I
don't
want to display their birth year so I entered dd/mmmm in the birthdate
field
but it still sorts by year.

Thanks - George
 
Back
Top