Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excluding negative from grand total 1

Status
Not open for further replies.

rileypetty

Programmer
Jan 20, 2007
43
US
I’m having a difficult time figuring out how to deal with one record out of eight where the amount should not be included in a grand total formula. The records are invoices with a “status” field. In seven records the status is “Approved” and one is “Void”. The amount is a positive amount in all records and I want the detail to print but exclude the single “Void” record from the grand total. I tried;

If {tblInvoiceRecord.Status} = “Void” Then
({tblInvoiceRecord.Amount} = -{tblInvoiceRecord.Amount})
Else
({tblInvoiceRecord.Amount} = +{tblInvoiceRecord.Amount})

But I’m obviously out in left field. Can someone point me in the right direction?
 
If {tblInvoiceRecord.Status} = "Void" Then
0 Else
{tblInvoiceRecord.Amount}

This assumes that the void record is not intended to cancel out a record on another row--if that is the case, you would instead use the following:

If {tblInvoiceRecord.Status} = "Void" Then
-{tblInvoiceRecord.Amount} Else
{tblInvoiceRecord.Amount}

-LB
 
Thank you very much for responding so quickly. It’s a service order system and when an error is made you void out that particular invoice and its status is changed from “Approved” to “Void”. If the invoice is reentered then the new amount is included in the grand total. The original invoice (Void) stays in the system and prints on the report but is not included in the grand total for the report in question. In today’s case the amounts were the same due to the error being with a customer address change. Thanks again for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top