Change the result format of a true/false column

G

Guy Cohen

Hi all.
I would like to change the result coming from a query as follows
Lets say I have a table with columns:
C1 [Long] and C2[Boolean]
select * from mytable returns

1 get results (e.g.):

1 true
2 false
3 true
4 false

I would like to alter the result so true values output "Product A" and false
will output "Product B"

e.g.:

1 Product A
2 Product B
3 Product A
4 Product B

How do I do that with:
VB6+ADO 2.8+MS HFlexgrid

TIA
Guy
 
W

Wart

Try something like
Select C1, 'Product' = CASE
WHEN C2 = False then 'Product B'
ELSE 'Product A'
END
FROM MyTable
HTH,
CF
 
Top