I wanted to convert my date format From MMMM dd,yyyy
to yyyy-MM-dd
.
I tried using the following:
SET @dt_to = STR_TO_DATE(dateTo, '%d-%m-%Y');
but returns a NULL
value.
How will I convert my date to yyyy-MM-dd
format in MySQL?
EDITED:
I am creating a procedure in which the value of dateTo
was received in the parameter. It is a date in MMMM dd, yyyy
format. E.g. October 10, 2015
.
NOTE:
The whole query does not return NULL
when I use:
SET @dt_to = dateTo;