NULL problem
Posted: Thu Jan 30, 2014 7:17 pm
I have a problem, I use Stimulsoft Reports.Fx for PHP.
I have a query that's like this:
SELECT CASE
WHEN tipo_lancamento = 'D'
THEN valor*-1
ELSE valor
END as resultado,
CASE
WHEN tipo_lancamento = 'D'
THEN valor*-1
END as despesas,
CASE
WHEN tipo_lancamento = 'R'
THEN valor
END as receitas,*
FROM v_despesas where (dedu_indedutivel<>2 or tipo_lancamento='R') and (data_pagamento>={data_inicial} and data_pagamento<={data_final}) order by data_lancamento
everything works fine until I use the sum function, if any of the results return NULL from the database it does not show the value in the summary
the problem is in "receita" "despesas" of the case
I have a query that's like this:
SELECT CASE
WHEN tipo_lancamento = 'D'
THEN valor*-1
ELSE valor
END as resultado,
CASE
WHEN tipo_lancamento = 'D'
THEN valor*-1
END as despesas,
CASE
WHEN tipo_lancamento = 'R'
THEN valor
END as receitas,*
FROM v_despesas where (dedu_indedutivel<>2 or tipo_lancamento='R') and (data_pagamento>={data_inicial} and data_pagamento<={data_final}) order by data_lancamento
everything works fine until I use the sum function, if any of the results return NULL from the database it does not show the value in the summary
the problem is in "receita" "despesas" of the case