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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sum for grouping with condition

Status
Not open for further replies.

snoopyyu

Programmer
Jan 9, 2004
12
US
Hi,

My report has the following columns:
BillDate, Invoice, Client, Matter, Fees, Costs, Age

My report is grouped by the &quot;Age&quot; field in my database. For each group, I need to get the sum(Fees) where invoice < 0 and the sum(Fees) where invoice > 0. Any ideas on how can I do it? Thanks in advance.
 
Create two running totals:

//#NegativeInvoices
if {table.invoice} < 0 then
(table.invoiced}
else
0

//#PositiveInvoices
if {table.invoice} > 0 then
(table.invoiced}
else
0

Set them both to reset on change of group Age.

-dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top