Subject | Re: Example of CalculateFields ! |
---|---|
Author | mmusetti70 |
Post date | 2009-06-08T18:17:39Z |
--- In IBObjects@yahoogroups.com, "Joao Henrique Levada" <joaolevada@...> wrote:
Thanks for your help,
Marcos
>Well, I did like you showed, but it works with only first record. What's wrong ?
> --- 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...
>
Thanks for your help,
Marcos