Rather than use ftDateTime as the param field type, use ftTimeStamp. You will need to create a variable of type TSQLTimeStamp and use the DateTimeToSQLTimeStamp function if you want to convert a TDateTime value to a TSQLTimeStamp. You will need to add: SqlTimSt to your uses clause. Here is a code snippet that demonstrates using SQLTimeStamp:
procedure TForm1.UseTimeStamp(myDate: TDateTime);
var
mySTS: TSQLTimeStamp;
begin
mySTS := DateTimeToSQLTimeStamp(myDate);
with SQLQuery1 do
begin
Params.CreateParam(ftTimeStamp, 'DATE', ptInput);
ParamByName('DATE').AsSQLTimeStamp := mySTS;
SQL.Text := 'INSERT INTO PARAMTABLE ' +
'(DATEFIELD) ' +
'VALUES (:DATE)';
ExecSQL(false);
end;
end;
Last Modified: 16-JUL-03