...

View Full Version : Changing Format



imatrox05
06-23-2006, 07:29 AM
i have a simple query.

I am extracting data from a database and creating a report. The date in the database is stored in the format YYYY-MM-DD HH:MM:SS but when i display the report i just want the date to be displayed as MM/DD

lavinpj1
06-23-2006, 08:42 AM
date_format in your mysql query...

http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html

Something like...

SELECT `field1`, `field2`, DATE_FORMAT(`dateField`, %c/%d) FROM `table` etc...

~Phil~



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum