Page 1 of 1

ZQuery.Lookup does not return TDateTime value

Posted: 16.07.2020, 11:19
by ash71
hello.
latest Lazarus win32 with ZeosLib 7.3 and sql server 2014

In my case:
varArray := ZQuery.Lookup'('ID', valueID, 'ID;DateAndTime;');
varArray [1] is null;

for me I fixed in ZVariant.pas

function EncodeVariant(const Value: TZVariant): Variant;
added:

vtTimeStamp: // MYFIF
begin
if TryTimeStampToDateTime(Value.VTimeStamp, dt)
then Result := dt
else Result := Null;
end;

Re: ZQuery.Lookup does not return TDateTime value

Posted: 16.07.2020, 15:11
by marsupilami
Hello and welcome to the forums :)

Your fix has been included in Rev. 6714. Thank you for helping :)

Best regards,

Jan

Re: ZQuery.Lookup does not return TDateTime value

Posted: 17.07.2020, 05:09
by EgonHugeist
I found some more missing conversions and did add all of them in https://sourceforge.net/p/zeoslib/code-0/6716/