Subject Re: Example of CalculateFields !
Author Joao Henrique Levada
--- In IBObjects@yahoogroups.com, "mmusetti70" <mmusetti70@...> wrote:
>
> Hi, in my table I have a field DATE. How do the difference between the current date and the field DATA using CalculateFields ?


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);


Don't try just copy and paste this code. This is a tip.

See ya...