Subject Re: [IBO] Calculated Fields...
Author Helen Borrie
At 04:00 AM 04-04-01 +0000, you wrote:

> > TIB_Query w/IBOTable? You can't mix IBOTable with TIB_* components.
> > Please explain what you are attempting to do.
>
>You've said before that to view the contents of the table in IB_Grid
>is to use IB_Query, So if i have made a new fields (w/c is calculated
>field) at design time,

How did you do that for IB_Query?

>how can i also display this fields using
>IB_query or are there any ways fo this ???, I try SELECT * FROM TABLE
>in IB_Query but the calculated fields are not displayed...

You need a query that includes the calculated (computed) column, e.g.

select field1, field2, fieldx ||' '||fieldy as MyCalcField
from table
where <some restricting criteria>

Alternatively, you can define calculated fields for TIB_ objects using the stringlist property CalculatedFields (one line per field) - these definitions look just like the metadata you would create in a CREATE TABLE or ALTER TABLE statement. This property defines the columns; you need to write handler code for the OnCalculateField event, on a row-by-row basis, referring to the TIB_Row object that is passed to the event.

You also need to go into the ColumnAttributes editor for this query and set COMPUTED to true.

hth,
Helen

All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________