How to part DATE and TIME from DATETIME field type in MySQL? 
//Use the following query:
SELECT DATE(`date_time_field`) AS date_part, TIME(`date_time_field`) AS time_part FROM `your_table`;

//Also you can use:
SELECT DATE_FORMAT(colName,'%Y-%m-%d') DATEONLY,DATE_FORMAT(colName,'%H:%i:%s') TIMEONLY FROM `your_table`;

http://stackoverflow.com/questions/1233 ... e-in-mysql

Comments
Comments are not available for this entry.
2024 By Angel Cool