sorting question

S

steve goodrich

I have a database which includes a date of birth field'
I run a report based on a query showing me the "birthdays this month"
I added a column to the query Month([date of birth]) criteria Month(Now())
I would like to sort the birthdays by day - when I sort by the date of birth
it sorts by year
how do I get it to sort by day
many thanks
Steve
 
F

fredg

I have a database which includes a date of birth field'
I run a report based on a query showing me the "birthdays this month"
I added a column to the query Month([date of birth]) criteria Month(Now())
I would like to sort the birthdays by day - when I sort by the date of birth
it sorts by year
how do I get it to sort by day
many thanks
Steve

If this is in a report, then the sorting order of the query is
irrelevant.
You must sort the report in the report's Sorting and Grouping dialog.
In Report Design View, click on View + Sorting and Grouping.
In the Field/Expression column, write on the top line:

=Format([DateOfBirth],"dd mm")
Set the sort to Ascending.

Since your query is being filtered to return only the current month
birth dates, the report will display the records sorted by that
month's days.
 
S

steve goodrich

Many thanks Fred, worked perfectly
fredg said:
I have a database which includes a date of birth field'
I run a report based on a query showing me the "birthdays this month"
I added a column to the query Month([date of birth]) criteria
Month(Now())
I would like to sort the birthdays by day - when I sort by the date of
birth
it sorts by year
how do I get it to sort by day
many thanks
Steve

If this is in a report, then the sorting order of the query is
irrelevant.
You must sort the report in the report's Sorting and Grouping dialog.
In Report Design View, click on View + Sorting and Grouping.
In the Field/Expression column, write on the top line:

=Format([DateOfBirth],"dd mm")
Set the sort to Ascending.

Since your query is being filtered to return only the current month
birth dates, the report will display the records sorted by that
month's days.
 

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