Follow the code:
//informações necessarias para inserir no DB.
coo := copy(lTemp,53,6);
ccf := copy(lTemp,47,6);
ecf := copy(lTemp,4,20);
//Data sendo formatada para ser inserida
dtc1:= StrToDate(copy(lTemp,65,2)+'/'+copy(lTemp,63,2)+'/'+copy(
lTemp,59,4));
//Query para inserção de linha no DB.
DModuleGrid.ZQuery2.Close;
DModuleGrid.ZQuery2.SQL.Clear;
DModuleGrid.ZQuery2.SQL.Add('INSERT INTO tabc460(dtcompra, impcaixa, numcupom, ccf, valor) VALUES ( "'+DateTimeToStr(dtc1)+'", "'+ecf+'", "'+coo+'", "'+ccf+'", "'+FloatToStr(valortxt)+'")');
DModuleGrid.ZQuery2.ExecSQL;
DModuleGrid.ZQuery2.Close;
DModuleGrid.ZQuery2.SQL.Clear;
DModuleGrid.ZQuery2.SQL.Add('SELECT * FROM tabc460 ORDER BY dtcompra LIMIT 0,'+valor);
DModuleGrid.ZQuery2.Open;
Well, what I need is just to hit the format of the date, because when I format it above, it appears very well in the Show Message, the two formats are ok dd/mm/yyyy
, but when I go to the database it everything is scrambled 20/03/2023
instead of 17/03/2014
.
What could be wrong?