Sorting dates by month

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?
 
K

karl dewey

Yes --
SELECT Name, Format([DOB], "mmmm") AS [Birthday]
FROM YourTable
SORT BY Format([DOB], "mm"), Name;
 
F

fredg

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.
 
F

fredg

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.
 
D

Dave Eliot

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.
 
D

Dave Eliot

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.
 
A

aaron.kempf

in your table, you can make a calculated column

ALTER TABLE employees ADD BirthMonth = Month(BirthDate)
 

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