Subject Re: [IBO] Re: Example of CalculateFields !
Author Helen Borrie
At 04:17 AM 9/06/2009, you wrote:

>> You need to declare the calculated field metadata on CalculetedFields property, like:
>>
>> DAYS INTEGER
>>
>> So, on the OnCalcFields event, you can fill the value:
>>
>> IB_Query1.FieldByName('DAYS').AsInteger := DaysBetween(IB_Query1.FieldByName('MY_DATE').AsDate, Date);
>>
>
>
>Well, I did like you showed, but it works with only first record. What's wrong ?

Apply the calculation to the Row object, e.g.

with IB_Query1.Row do
begin
ByName('DAYS').AsInteger := DaysBetween (ByName('MY_DATE').AsDate, Date);
end;

Helen