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!

Simple Formula not working 1

Status
Not open for further replies.

Croaks

Programmer
Jun 29, 2004
26
GB
Hi

I havnt used CR for ages and now im struggling with a formula.

I have a table with sales figures on, each entry has a code attached (C, I or P) and i need 2 formulas, 1 to add up all the totals for entries with C and one to Add up all with I.

I then plan the subtract one formula from the other

heres what ive got but it just adds everything up ignoring essentially the 1st part of the formula, i must be missing something

IF {InvoiceHeader.TYPE} <> "C"
THEN SUM ({InvoiceHeader.TOTALVALUE})

Help Please!


Cheers Croaks
 
Create this formula to return the ammoun for the C's:

If {InvoiceHeader.TYPE} = "C" then
{InvoiceHeader.TOTALVALUE}
Else
0

Place this formula in the details section and suppress it.

Next, create this formula to return the ammoun for the I's:

If {InvoiceHeader.TYPE} = "I" then
{InvoiceHeader.TOTALVALUE}
Else
0

Place this formula in the details section and suppress it.

Lastly, create another formula to subtract the sum of each formula and place it in the report Footer for display:

Sum({@C_Vals}) - Sum({@I_Vals})


~Brian
 
Nice one!

That did the job

Thanks a lot
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top