General information
Category:
Reports & Report designer
Title:
Report Calculations with SQL
Hi all,
I have this SQL statement to retrive some information to my report, and now before i print it i need to do some calculations,
in my table documentoscablin i have two percent fields (discount1=5.0%,discount2=3.0%), now i need to create a field with this formula (qt*prunit-(value dicount1-value discount2) to get the liquid value. How can i do that?
select *;
from jbfic!documentoscabcli a ;
inner join jbfic!documentoslincli b ;
on a.c_tipodoc = b.c_tipodoc ;
and a.c_armazem = b.c_armazem ;
and a.c_cod_ser = b.c_cod_ser ;
and a.c_numdoc = b.c_numdoc ;
and between (a.c_tipodoc+a.c_armazem+a.c_cod_ser+a.c_numdoc, lcP, lcU) ;
left outer join jbfic!documentos c ;
on a.c_tipodoc=c.c_codigo ;
left outer join jbfic!clientes d ;
on a.c_codcli=d.c_codigo ;
order by a.c_tipodoc, a.c_armazem, a.c_cod_ser, a.c_numdoc ;
into cursor facturas
Thanks in Advance
João Batista
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only