Page 1 of 1

NULL problem

Posted: Thu Jan 30, 2014 7:17 pm
by Ricardão
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

Re: NULL problem

Posted: Fri Jan 31, 2014 6:11 am
by HighAley
Hello.

What value returns the SQL query with Sum function if you run it on the SQL server?
If yes, please, send us sample report template with data which reproduces the issue.
You could read how to prepare question on our Knowledge Base

Thank you.