3
the question gets even harder:
the field data_cadastro
is as sweep, I have several tables and each one of them has a different type of date, for example:
in a table there:
- 2015-12-01;
in the other:
- 12/07/2015;
and in another:
- 14-05-2015
etc....
there is some way to return if this date is of type yyyy-mm-dd, dd-mm-yyyy, dd/mm/yyyy and vice versa?
Assuming there are no 2-digit years, you could check whether the 3rd character is a slash or a dash. If it is, you have the date in the format dd/MM/yyyy or dd-mm-yyyy. I think there must be some other way, but on the face, I don’t know.
– emanuelsn
There are several examples of SQL statements that allow updating the column value to a given format (
str_to_date
). When finished, just change the column toDatetime
– Felipe Douradinho