Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sorting on the Month of a date of birth

Status
Not open for further replies.

MrsNic

Instructor
Feb 6, 2005
44
GB
I have a query in which I have used DatePart to separate the day and the month from a person's date of birth.

I am trying to create a report that will sort the birthdays into Months. I have tried using Date of birth - month but it still sorts into the different years e.g. jan 1990 Feb 1990 . . . then Jan 1991 etc.

I have also tried to get it to sort on the datepart month, this works but only shows 1, 2 or 3 etc. I have tried changing the formatting for this but with no success.

Any ideas please.
 



Or...
Code:
Select Format([Birthdate],"mm-dd")...
from...
...
Order by 1
will sort better than "mmm", and will include the day as well if so desired.

Skip,

[glasses] When a diminutive clarvoyant had disappeared from detention, headlines read...
Small Medium at Large[tongue]
 
The sort order in the query generally doesn't make any difference. Set the sorting and grouping in the report and use an expression like:
=Month([YourDateField])

Duane MS Access MVP
Now help me support United Cerebral Palsy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top