TDateTime & TMyQuery

TDateTime & TMyQuery

Postby kenny » Mon 15 Nov 2004 11:07

Hi, I'm using MyDac v3.3

This is my query
SELECT
Min(SystemDate) AS MinOfSystemDate,
MonthEnd,
MonthEndProcess
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:
kenny
 
Posts: 43
Joined: Mon 15 Nov 2004 08:48
Location: Malaysia

Re: TDateTime & TMyQuery

Postby Ikar » Mon 15 Nov 2004 16:10

Try to apply to this field not as Variant, but, for example as AsInteger.
Ikar
 
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Postby kenny » Mon 15 Nov 2004 16:43

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!
kenny
 
Posts: 43
Joined: Mon 15 Nov 2004 08:48
Location: Malaysia


Return to MySQL Data Access Components