The problem persists.
So I will explain more my issue.
I have a function that assigne a Database field of type Datetime with a value from TDateTimePicker (not TDBDateTimePicker)
the function is
function fQueryAssignVal( oQuery: TQuery; // the query
sFName: String; // field name on DB
fDataType: ftDataType, // type of field, ftstring ....
fValue: Variant // Value that will be Assigned.
); boolean;
begin
if (fDataType in [ftDate]) then
begin
if ( TDateTime(psValue) <> TDateTime(NullDate) ) then
psValue := TDate(VarToDateTime(psValue))
else psValue := Null;
if (psValue = 0) then
psValue := NULL;
//if ( VarToDateTime(psValue) <> NullDate )
// psValue:= Trunc(psValue);
end;
end;
// WHEN CALLING
// .....
fQueryAssignVal( qryPTNS, 'DateNais', ftDate, DtPicker.Date);
//....
qryPTNS.Execute;
if DtPicker Date is not null itworks, but if it is null It gives me Error Conversion.
I do not know what to do really.
Please help.