Query for calculating in percentages between 2 Fields?

Goat.Cheese

Registered User.
Local time
Today, 08:39
Joined
Jul 10, 2012
Messages
20
I have 3 fields in the query. The first is the company name, second is a for the total profit made in sales i.e. the positive(or sometimes negative) difference between expenses incurred to have the item/s in stock and how much i have sold it/them for. The third one represents the sum total of the sales.

Ex: If it costs me 2.00$ to procure an item, which i then sell for 3.60$, then the 1.60$ would be in the "profit" field and the total amount of 3.60$ would be in the sales "total" one.

I apologize if this oversimplifiction insults your intelligence, but i wanted to be as clear as possible.

So what Im looking to do is creating a query which will tell me the percentage of the the profit i've made from the total sales to each company
 
Look at "DemoPercentageA20022003.mdb (attachment, zip).
Run Query1 and see.

Company | Profit|Sales total| Expr:1 Percent: [F1]/[F2]*100
Group by | Sum |Sum |


Returns an "overflow" error message. I read that it is probably because i tried division by zero, but Expr1: Nz([Profit]*100)/Nz([Sales]), returns the same error.

Suggestions?
 
Why you have got a ZERO in F2 field ???
 
Because the total record includes 3606 companies and one of them has a recorded one-time purchase that amounts to 0,4199 of the currency in question.

I solved the pecentage equation, by saving the query result that sums the profits and totals from each company and used these calculated values to perform the EXPR1: [F1]/[F2]*100.
 

Users who are viewing this thread

Back
Top Bottom