Page 1 of 1

Date extracting function in SQL

Posted: Fri Jul 25, 2008 1:38 am
by vcodeinfotec
Hello,

Can anyone help me!!!

2008-07-06 16:46:15
2008-07-06 16:47:44
2008-07-06 10:18:25
2008-07-24 14:38:25
If these are the records in a table i need to get the output like this:

2008-07-06
2008-07-24

Please help

Re: Date extracting function in SQL

Posted: Fri Jul 25, 2008 2:04 am
by sureshmaharana
Try this:

SELECT date_format( Date, '%Y-%m-%d' ) AS date
FROM table name

where Date is your table's field name.