Был запрос:
select Fuel.Marka, Osnovan.Name, SUM(Statist.LitFact) Litr,
SUM(Statist.CurFact) Summa,
((SUM(Statist.LitFact)*Statist.Price))-SUM(Statist.CurFact)) Delta
from Fuel, Statist, Osnovan
where
Statist.DateTime>=:QDBeg and Statist.DateTime<=:QDEnd
and
Statist.Product=Fuel.Num
and
Statist.Osnovanye=Osnovan.Num
group by Marka, Name
having SUM(Statist.CurFact)<>0
union
select Fuel.Marka, Osnovan.Name, SUM(Statist.LitFact) Litr,
SUM(Statist.CurFact) Summa,
((SUM(Statist.LitFact)*0))-SUM(Statist.CurFact)) Delta
from Fuel, Statist, Osnovan
where
Statist.DateTime>=:QDBeg and Statist.DateTime<=:QDEnd
and
Statist.Product=Fuel.Num
and
Statist.Osnovanye=Osnovan.Num
group by Marka, Name
having SUM(Statist.CurFact)=0
усё работало.
Приспичило поставить округление, ставил cast и round
select Fuel.Marka, Osnovan.Name, SUM(Statist.LitFact) Litr,
SUM(Statist.CurFact) Summa,
(cast((SUM(Statist.LitFact)*Statist.Price) as decimal(15,2))-SUM(Statist.CurFact)) Delta
from Fuel, Statist, Osnovan
where
Statist.DateTime>=:QDBeg and Statist.DateTime<=:QDEnd
and
Statist.Product=Fuel.Num
and
Statist.Osnovanye=Osnovan.Num
group by Marka, Name
having SUM(Statist.CurFact)<>0
union
select Fuel.Marka, Osnovan.Name, SUM(Statist.LitFact) Litr,
SUM(Statist.CurFact) Summa,
(cast((SUM(Statist.LitFact)*0) as decimal(15,2))-SUM(Statist.CurFact)) Delta
from Fuel, Statist, Osnovan
where
Statist.DateTime>=:QDBeg and Statist.DateTime<=:QDEnd
and
Statist.Product=Fuel.Num
and
Statist.Osnovanye=Osnovan.Num
group by Marka, Name
having SUM(Statist.CurFact)=0
select Fuel.Marka, Osnovan.Name, SUM(Statist.LitFact) Litr,
SUM(Statist.CurFact) Summa,
(round((SUM(Statist.LitFact)*Statist.Price),2)-SUM(Statist.CurFact)) Delta
from Fuel, Statist, Osnovan
where
Statist.DateTime>=:QDBeg and Statist.DateTime<=:QDEnd
and
Statist.Product=Fuel.Num
and
Statist.Osnovanye=Osnovan.Num
group by Marka, Name
having SUM(Statist.CurFact)<>0
union
select Fuel.Marka, Osnovan.Name, SUM(Statist.LitFact) Litr,
SUM(Statist.CurFact) Summa,
(round((SUM(Statist.LitFact)*0),2)-SUM(Statist.CurFact)) Delta
from Fuel, Statist, Osnovan
where
Statist.DateTime>=:QDBeg and Statist.DateTime<=:QDEnd
and
Statist.Product=Fuel.Num
and
Statist.Osnovanye=Osnovan.Num
group by Marka, Name
having SUM(Statist.CurFact)=0
выдаёт Capability not supported ??? сия конструкося не поддерживается.
Как решить эту задачу