Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

adodc 1

Status
Not open for further replies.

Taxidriver

Programmer
Jan 15, 2002
79
0
0
IT
I build a datagrid using

Adodc1.RecordSource = "SELECT DettaglioLavoriOre.idDettaglio,DettaglioLavoriOre.IdTipo as C200_C201 FROM etc etc..."

the data in IdTipo can be 0 or 1 or 2.
I would prefer to have C200 if the value is 2 and C201 if the value is 1, displayed in the datagrid.
Is it possible to do it via code?
 
depending on the DB used you can use the CASE instruction.

something like
select
case
when idtipo = 1 then "C201"
when idtipo = 2 then "C200"
... from mytbl ...

Look at your DB documentation on how to use this if available.

Regards

Frederico Fonseca
SysSoft Integrated Ltd
 
Well you could
Add a table in your database with 2 cols
IDTipo and IDTipoValue field
and modify your recorsource. (a query including this table)

Or don't use an ADODC1 and fill the whole grid by code using a recordset.

Or maybe there is a way to fiddle around with the SQL statement but I am not sure it is possible, and quite sure the other solutions are preferable.


 
Thanks Frederico! It worked well! I'm trying to give you a star but when I click on the link it does nothing!
Thank you!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top