MySQL Forums
Forum List  »  General

From 4.0.12 to 4.1.19 Bug or normal behavior
Posted by: Eugen Christo
Date: January 21, 2005 03:12PM

The SQL below worked in 4.0.12 but not in 4.1.19
In version 4.0.12 columns current,days30,days60,days90 return 0 if no values but in
4.1.19 return NULL and I get no rows return because the Having clause dos not like NULLS. This is breaking some code for me but if is not a Bug I will make the changes needed.
Thanks

select p.PRespParty,
sum(CASE when TO_DAYS(CURRENT_DATE)-TO_DAYS(dia) <= 30 then t.ValuePac+t.ValuePaid end) as Current,
sum(CASE when TO_DAYS(CURRENT_DATE)-TO_DAYS(dia) between 31 and 60 then t.ValuePac+t.ValuePaid end) as Days30,
sum(CASE when TO_DAYS(CURRENT_DATE)-TO_DAYS(dia) between 61 and 90 then t.ValuePac+t.ValuePaid end) as Days60,
sum(CASE when TO_DAYS(CURRENT_DATE)-TO_DAYS(dia) >= 91 then t.ValuePac+t.ValuePaid end) as Days90
from tratexec t
left outer join paciente p on (p.pmecano = t.pac)
where (sitFac between 0 and 1)
group by p.PRespParty
having (format(current+ days30+ days60+ days90,2) <> 0)

Options: ReplyQuote


Subject
Written By
Posted
From 4.0.12 to 4.1.19 Bug or normal behavior
January 21, 2005 03:12PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.