>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
Joao,
You could have extra calculated field in your SQL. For example :
select *, quantity*price as "Extended" from orditems
Cetin