Subject Re: [IBO] Dumb calc fields question
Author chef_007@gmx.net
hi,

> --- Ursprüngliche Nachricht ---
> Von: Robert martin <rob@...>
> An: IBObjects@yahoogroups.com
> Betreff: [IBO] Dumb calc fields question
> Datum: Wed, 08 Feb 2006 09:24:20 +1300
>
> Hi
>
> I am using the TIB_Query component and have defined a calc field.
>
> In the Oncalc event I have the following code, which returns results but
> not the correct results !
>
>
> if (AField.FieldName = 'ETA') then begin
> AField.AsDateTime :=
> ARow.Statement.FieldByName('NextShipDate').AsDateTime;
> end;
Try ARow.ByName('NextShipDate').AsDateTime;
otherwise your not fetching the value from the buffer row that is currently
processing your event handler but instead from the row that is the currently
selected one.

>
> Do I need the 'if (AField.FieldName = 'ETA') then begin '. Is this
> code run once per row or once for each column in the row?
it's run for each calculated field.

> ARow.Statement.FieldByName('NextShipDate').AsDateTime; Is not returning
> the correct date. (no date at all). What is the correct way to access
> other field data?
>
>
>
> --
> Rob Martin
> Software Engineer
>
> phone +64 03 377 0495
> fax +64 03 377 0496
> web www.chreos.com
>
> Wild Software Ltd
>
>
>
>
___________________________________________________________________________
> IB Objects - direct, complete, custom connectivity to Firebird or
> InterBase
> without the need for BDE, ODBC or any other layer.
>
___________________________________________________________________________
> http://www.ibobjects.com - your IBO community resource for Tech Info
> papers,
> keyword-searchable FAQ, community code contributions and more !
> Yahoo! Groups Links
>
>
>
>
>
>