Reputation: 1498
I'm with a problem in following insert SQL below:
insert into cad_manutencao (id,
causa_provavel,
envio,
retorno,
nota_envio,
rastreamento,
transportadora,
chegou)
values (1,
'TESTANDO ASSISTENCIA',
'12/02/2015 15:00:00',
'12/02/2015 15:00:00',
'S/NF',
'Assistência',
1,
1)
When i run this SQL the MySQL return this warning:
"1265: Data truncated for column 'envio' at row 1"
This SQL works and the register is added, but the date fields are filled as NULL
How can i solve this problem?
Thanks a lot!
Upvotes: 1
Views: 5662
Reputation: 19915
This is not a valid format for a date in mysql. You have to change the query like this :
insert into cad_manutencao (id,
causa_provavel,
envio,
retorno,
nota_envio,
rastreamento,
transportadora,
chegou)
values (1,
'TESTANDO ASSISTENCIA',
'2015-02-12 15:00:00',
'2015-02-12 15:00:00',
'S/NF',
'Assistência',
Date format for mysql is yyyy-mm-dd.
Upvotes: 2