Page 1 of 1

TDateTime & TMyQuery

Posted: Mon 15 Nov 2004 11:07
by kenny
Hi, I'm using MyDac v3.3

This is my query
Min(SystemDate) AS MinOfSystemDate,
FROM SystemCalendar
GROUP BY MonthEnd, MonthEndProcess
HAVING MonthEnd=1 AND SystemCalendar.MonthEndProcess=0;

The SystemDate Datatype is Date
When I attempt to assign to TDateTime variable,

datSystemDate := QMySystemDate.Fieldbyname('MinOfSystemDate').value;

it occurred error: 'Invalid variant type conversion'. How to resolve this problem? THANKS! :cry:

Re: TDateTime & TMyQuery

Posted: Mon 15 Nov 2004 16:10
by Ikar
Try to apply to this field not as Variant, but, for example as AsInteger.

Posted: Mon 15 Nov 2004 16:43
by kenny
yes, i had tried it by using
datSystemDate := QMySystemDate.Fieldbyname('MinOfSystemDate').AsDateTime;

(the datSystemDate i declared as datSystemDate : TDateTime;)
but same error occurred.

Anyway, i had resolved this by create my own standard function to convert the statement. Thanks!