Jump to content
TNG Community
Marla

Change Birth Date in "Word" Birth Date

Recommended Posts

Marla

How can I change from numerical birth/death dates to " month word" birth/death dates, such as  1 Jan 2018"?

Capture.PNG

Share this post


Link to post
Share on other sites
JWidner

There is a format command in SQL that goes like this: DATE_FORMAT(date,format). The "format" portion for what you want is used as '%d %b %Y' be sure to include the quotes.

Here is an example I use for a birthdays report I use to show the current month's birthdays. I've put in bold what you are looking for.

SELECT lastname, firstname, DATE_FORMAT(birthdatetr,'%d %b %Y' ) AS Date_of_Birth, birthplace, MONTHNAME(birthdatetr) AS Month_of_Birth FROM tng_people WHERE MONTHNAME(birthdatetr) = MONTHNAME(CURDATE()) GROUP BY birthdatetr

In this example, the birthdatetr field comes out as e.g. 08 Aug 1777

 

 

 

Share this post


Link to post
Share on other sites
Marla
18 hours ago, JWidner said:

There is a format command in SQL that goes like this: DATE_FORMAT(date,format). The "format" portion for what you want is used as '%d %b %Y' be sure to include the quotes.

Here is an example I use for a birthdays report I use to show the current month's birthdays. I've put in bold what you are looking for.

SELECT lastname, firstname, DATE_FORMAT(birthdatetr,'%d %b %Y' ) AS Date_of_Birth, birthplace, MONTHNAME(birthdatetr) AS Month_of_Birth FROM tng_people WHERE MONTHNAME(birthdatetr) = MONTHNAME(CURDATE()) GROUP BY birthdatetr

In this example, the birthdatetr field comes out as e.g. 08 Aug 1777

 

 

 

Great!  Thank you for your advice.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×