Topic: SQL Report

Hey guys, i'm wondering, is there a way to get a workarround an SQL query where i have this boolean check box , i inserted the boolean table on the sql report, but it shows 0 or 1 instead of YES or NO.
I tried this:

CASE test.answer WHEN 1 THEN 'yes' WHEN 0 THEN 'no' ELSE '' END

but i can't seem to make it work on sql report.
any ideas?

2 (edited by mathmathou 2016-10-11 04:43:23)

Re: SQL Report

Hello VascoMorais,


Just a wild guess, both are correct '' or NULL but try it anyway.

SELECT
CASE
     WHEN test.answer = 1 THEN "YES"
     WHEN test.answer = 0 THEN "NO"
     ELSE NULL
END as answer
FROM
your.table.name

Hope this helps, I tested with both syntax and I got a report with YES and NO inside.
Better post your code non ?


Cheers


Mathias

I'm a very good housekeeper !
Each time I get a divorce, I keep the house

Zaza Gabor

Re: SQL Report

didn't work, but i'll try again later. cheers

Re: SQL Report

VascoMorais wrote:

didn't work, but i'll try again later. cheers

SELECT

CASE BoolField WHEN 1 THEN 'Yes' WHEN 0 THEN 'No' ELSE '' END

FROM tablename
Dmitry.

5 (edited by VascoMorais 2016-10-11 23:50:56)

Re: SQL Report

that worked like a charm

But i can't find the right syntax for multiple cases

Nevermind, forgot the "  , " at the end