hi guys,

i have a crystal report the display all transactions done, even the ones that are deleted, and there is a flg to know which ones are deleted.

i need to make a formula to calculate the sum of cash, the problem is that i dont know how to add a where condition not to add the deleted transactions to the totals.

i wrote this in the formula editor

Sum ({Transactions.Trans_Cash})

but this adds also the deleted ones. how can i ignore them. Transactions.Trans_delete_flg

thank you for the help

you can make a view like this

select i.invoiceNo , (i.amount) as Amount
from invoices i 
where i.IsDeleted = 0 
union all
select i.invoiceNo , 0 as Amount
from invoices i
where i.IsDeleted = 1

and use this view in your report . this and then just add summary at the end of report of column Amount.

Regards