Sort By Date and Month Only

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
 
A

Allen Browne

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

Guest

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
 
A

Allen Browne

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
 

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