I have problem in date columns to insert from varchar column to date column.
I used str_to_date and Date_Format functions but it doesn't solved. How Can I
Simple Example:
update Uye_Uye_Liste
set DogumTarihi=str_to_date(DogumTarihi,'%d.%m.%Y')
where DogumTarihi is not null;
ERROR 1292 (22007): Truncated incorrect date value: '23.07.2002 00:00:00'
alter table Uye_Uye_Liste modify DogumTarihi datetime;
ERROR 1292 (22007): Incorrect datetime value: '13-04-1996' for column 'DogumTarihi' at row 2
select DogumTarihi from Uye_Uye_Liste where DogumTarihi = '13.04.1996';
+-------------+
| DogumTarihi |
+-------------+
| 13-04-1996 |
+-------------+
Best Answer
My guess is that you have one or more malformed values. Given the information you provided:
So if every row corresponds to this pattern you should be alright. I suspect that some rows does not, focus on identifying and transforming those rows.
For the row given in the original query it is sufficient to to manually truncate the row using substr: