Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

convert yyyy-mm-dd hh:mm:ss to yyyy-mm-dd in sql

I need to convert yyyy-mm-dd hh:mm:ss.msec to yyyy-mm-dd in sql.

I tried

CONVERT(DATETIME,MIN(Vdaily_calender.VDC_day_date),120)

but getting same result.

Please advise

Thanks Ar

like image 571
Aruna Raghunam Avatar asked Oct 17 '16 14:10

Aruna Raghunam


1 Answers

I suspect you are overthinking it. A simple cast as date will do the trick

Select Cast(SomeDateTime as date)
like image 138
John Cappelletti Avatar answered Sep 30 '22 05:09

John Cappelletti