Board index » delphi » Delphi2-Logical Field True<=>Yes,False<=>No Display

Delphi2-Logical Field True<=>Yes,False<=>No Display

Hi,

Assuming I have a Logical field in the underlying table, I would
like to display the values of True/False as Yes/No (and vice versa)
in a data-aware component such as DBGRID.

How should I go about doing this?

Thanks for your help in advance. cc: to email address appreciated.

CL
4.22.96 0150 hr sg.
.

 

Re:Delphi2-Logical Field True<=>Yes,False<=>No Display


On zondag 21 april 1996, cllee wrote...

Quote
> Hi,

> Assuming I have a Logical field in the underlying table, I would
> like to display the values of True/False as Yes/No (and vice versa)
> in a data-aware component such as DBGRID.

> How should I go about doing this?

you could create a domain table for the yes/no field,
and create a view (in SQL or with a TQuery component) that joins your
original table and your domain table
Quote
> Thanks for your help in advance. cc: to email address appreciated.

> CL
> 4.22.96 0150 hr sg.
> .

Re:Delphi2-Logical Field True<=>Yes,False<=>No Display


Quote
Tom Cool <tom.c...@globe.be> wrote:
>On zondag 21 april 1996, cllee wrote...
>> Hi,

>> Assuming I have a Logical field in the underlying table, I would
>> like to display the values of True/False as Yes/No (and vice versa)
>> in a data-aware component such as DBGRID.

>> How should I go about doing this?

>you could create a domain table for the yes/no field,
>and create a view (in SQL or with a TQuery component) that joins your
>original table and your domain table
>> Thanks for your help in advance. cc: to email address appreciated.

Alternatively, set the OnGetText event of the field component to return the
text for 'Yes' and 'No' according as the field is true or false.

--
Isaac Hepworth                 ijh1...@cam.ac.uk
Corpus Christi College, Cambridge University, UK

Other Threads