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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

select date format 1

Status
Not open for further replies.

brownfox

Programmer
Jan 5, 2003
173
GB
In the data base dates are saved in this format:
1945-04-24 00:00:00
Can I select eg: "SELECT DOB from DB" them so they are returned as YYYY-MM-DD?
Thanks in advance...
 
Sure. It will involve invocation of MySQL's date_format() builtin function.

Something along the lines of:

SELECT date_format(DOB, '%Y-%m-%d') from DB....


Check the documentation on date_format(). My format string may or may not be right.

Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top