Subject Re: time casting problem...
Author Adam
Thanks to all!The problem is logical...conversion is ok...sorry for
disturb you...I increment ["StartDate" = "StartDate" + 1;] and I
forgot to reset it...so in the second loop I did not get results:(

>
> /*FIND IF AT LEAST ONE MEMBER HAS BEEN AT CURRENT ACTIVITY IN
> CURRENT DAY AND TIME RANGE*/
> while ("StartDate" <= "EndDate")
> do
> begin
> /*SELECT DATA IN SOME INTERVAL...*/
> select
> count( "Visit"."idPerson" )
> from
> "Visit"
> where
> "Visit"."idInstructor" = :"idInstructor" and
> cast("Visit"."Time" as date) = :"StartDate" and
> cast("Visit"."Time" as time) between cast(:"StartTime" as time)
> and cast(:"EndTime" as time)
> into
> :"IsActivityVisited";
>
> /*COUNT HOURS*/
> if (:"IsActivityVisited" > 0 ) then
> begin
> "InstructorActivityHours" = "InstructorActivityHours" + 1;
> end
>
> /*reset*/
> "IsActivityVisited" = 0;
>
> "StartDate" = "StartDate" + 1;
>
> end
> ///////////////////////////////////////////////////////////////
>