Sorting dates by month

  • Thread starter Thread starter Dave Eliot
  • Start date Start date
D

Dave Eliot

I have a date field for DOB, from which I calculate present age. What I
need to do is sort the DOB field by month so that I can calendar
birthday cards. Is this possible?
 
Yes --
SELECT Name, Format([DOB], "mmmm") AS [Birthday]
FROM YourTable
SORT BY Format([DOB], "mm"), Name;
 
I have a date field for DOB, from which I calculate present age. What I
need to do is sort the DOB field by month so that I can calendar
birthday cards. Is this possible?

In your query, add a new column.
SortByMonth:Month([DOB])

Use this column to sort the query by month.

However if you are using this data in a report, you must use this new
field in the report's Sorting and Grouping dialog to effectively sort
the report.
 
I have a date field for DOB, from which I calculate present age. What I
need to do is sort the DOB field by month so that I can calendar
birthday cards. Is this possible?
Dave,
You've been posting for a long time now.
Answered elsewhere.
Please do not multi-post. If you feel you must post the same question
to more than one newsgroup (and it's seldom necessary), crosspost by
adding each additional newsgroup in the To Newsgroups: box, separated
by a comma.
This way an answer in one newsgroup will be seen in each of the
others. More readers will see the response and learn, and less time
will be spent on duplicate answers.

See Netiquette at http://www.mvps.org/access

It's a great site to visit anyway.
 
fredg said:
I have a date field for DOB, from which I calculate present age. What I
need to do is sort the DOB field by month so that I can calendar
birthday cards. Is this possible?

In your query, add a new column.
SortByMonth:Month([DOB])

Use this column to sort the query by month.

However if you are using this data in a report, you must use this new
field in the report's Sorting and Grouping dialog to effectively sort
the report.

This did the trick for the query. Thanks so much.
 
fredg said:
Dave,
You've been posting for a long time now.
Answered elsewhere.
Please do not multi-post. If you feel you must post the same question
to more than one newsgroup (and it's seldom necessary), crosspost by
adding each additional newsgroup in the To Newsgroups: box, separated
by a comma.
This way an answer in one newsgroup will be seen in each of the
others. More readers will see the response and learn, and less time
will be spent on duplicate answers.

See Netiquette at http://www.mvps.org/access

It's a great site to visit anyway.

Sorry, I don't remember asking this question in any of the other groups.
My need for this just came up today. I did not know about the site you
mention -- am checking it out.

Thanks.
Thanks.
 
in your table, you can make a calculated column

ALTER TABLE employees ADD BirthMonth = Month(BirthDate)
 
Back
Top