I changed the formula a bit as I was not getting the correct percentage, I just divided the open by the total and it worked. Select Sum(T0.DocTotalSy) as 'Total Invoices', Sum(T1.DocTotalSy - T1.Paidsys) as 'Total Open', (( Sum(T1.DocTotalSy - T1.Paidsys) / Sum(T0.DocTotalSy)) * 100) From OINV T0 left outer join oinv T1 on t0.docentry = t1.docentry and T1.DocStatus = 'O' Where T0.[TaxDate] between '2016/06/01' and '2016/06/30'
↧