Subject | Re: Example of CalculateFields ! |
---|---|
Author | Joao Henrique Levada |
Post date | 2009-06-08T17:05:03Z |
--- In IBObjects@yahoogroups.com, "mmusetti70" <mmusetti70@...> wrote:
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...
>You need to declare the calculated field metadata on CalculetedFields property, like:
> Hi, in my table I have a field DATE. How do the difference between the current date and the field DATA using CalculateFields ?
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...