Month/Day from DOB in a query (help)

pujo

Well-known Member
Joined
Feb 19, 2009
Messages
708
Office Version
  1. 2019
  2. 2013
Platform
  1. Windows
Hello group.

I have a table field "Date of Birth", format mm/dd/yyyy
In a query, I would like to extract only the month and day sorted by month (Jan thru Dec).
This is just a birthday list that I am trying to make.

Cannot figure out the syntax to get it done...

It's been a long, long time since I worked with queries, please help if you can.

Thanks,
PuJo
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
basically
your dispalycell = text(yourdate,"mmmm - dd"

you might need
your dispalycell = text(yourdate,"mm - mmmm - dd" to sort in a cell

That of course the excel way (Again i'm reading access questions oops)
 
Last edited:
Upvote 0
Thanks for the quickness, and great answer.
I still have the sorting problem. I wanted to sort from Jan to Dec but the dates are all over the place...

Any ideas?

Current sorting the month by first letter, (April, August, December....)
 
Last edited:
Upvote 0
well your doing this in access (aren't you) so for display you sort the table when you read the data
 
Upvote 0
well your doing this in access (aren't you) so for display you sort the table when you read the data

Yes, I am doing this in Access and trying to sort this in a query, not a table.

Maybe I am doing it wrong..... still not working
 
Upvote 0
so in SQL Query it would be

SELECT *
FROM Tbl
WHERE
ORDER BY probably sort from here
 
Upvote 0
Code:
select 
  year( tbl.[Date of Birth] ) as [Year of DOB], 
  month( tbl.[Date of Birth] ) as [Month of DOB], 
  day( tbl.[Date of Birth] ) as [Day of DOB], 
  tbl.YourPrimaryKey 
from
  tbl 
order by 
  year( tbl.[Date of Birth] ), 
  month( tbl.[Date of Birth] ), 
  day( tbl.[Date of Birth] )
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,749
Members
448,989
Latest member
mariah3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top