Trouble with percentage on report

G

Guest

I'm trying to display an estimated gross profit percentage on a report, but I
keep getting syntax error messages and have tried a variety of expressions.
I'm wondering if anyone could offer some help in creating the correct
expression.

I have two text boxes:
- "CostTotal" , which is the sum of another field in the detail section of
the report called LineTotalCost. The expression in this is
=Sum([LineTotalCost]).
- "ContractTotal" , which is the sum of another field in the detail section
of the report called SellPrice, plus a manually entered sales tax amount. The
expression in this is =Sum([SellPrice])+[SalesTaxAmount].
Both of these work perfectly.

The result I'm looking for would take the difference between CostTotal and
ContractTotal, and calculate what percentage of ContractTotal that is. For
example: If CostTotal is $40,000, and ContractTotal is $50,000, the gross
profit percentage would calculate to be 20%. I have tried numerous
configurations and an equal amount of error messages have been the result.
Seems simple, but I just cant get it to work. It didn't seem to acknowledge
the "Name" of each text box either (in some of my attempts).

All suggestions are greatly appreciated!
 
M

Marshall Barton

Kevin said:
I'm trying to display an estimated gross profit percentage on a report, but I
keep getting syntax error messages and have tried a variety of expressions.
I'm wondering if anyone could offer some help in creating the correct
expression.

I have two text boxes:
- "CostTotal" , which is the sum of another field in the detail section of
the report called LineTotalCost. The expression in this is
=Sum([LineTotalCost]).
- "ContractTotal" , which is the sum of another field in the detail section
of the report called SellPrice, plus a manually entered sales tax amount. The
expression in this is =Sum([SellPrice])+[SalesTaxAmount].
Both of these work perfectly.

The result I'm looking for would take the difference between CostTotal and
ContractTotal, and calculate what percentage of ContractTotal that is. For
example: If CostTotal is $40,000, and ContractTotal is $50,000, the gross
profit percentage would calculate to be 20%. I have tried numerous
configurations and an equal amount of error messages have been the result.
Seems simple, but I just cant get it to work. It didn't seem to acknowledge
the "Name" of each text box either (in some of my attempts).


A text box with the expression:
=1 - CostTotal / ContractTotal
should provide the percentage you want.

I can imagine that giving various jubds of errors when you
speel a name wrong or use the expression in an inappropriate
place, but I can't see how it could give you a syntax error.
 
G

Guest

As I said, it seems like it should be simple. This works great and returns
the results I was looking for. Sometimes I try to make things harder than
they need to be. Thanks for the help!
Kevin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top