PDA

View Full Version : Tenou needs a little AccesDB help


Tenou
February 7th, 2007, 10:25 AM
Ok, I've been trying to work this one out for the past 2 and a half hours. I guess my proff meant it when she said that math skills were a must. Too bad I didn't believe her.

Ok, my problem: I have to find the total dollar amount of orders placed... the catch? The discount. So, I've tried
Order Total:[Selling Price]*[Quantity]-[Discount]

I double checked that Discount is a percentage; yes it is, but try Discount/100... which gives me 0.0005 instead of 0.05. So I know that on some level, it's recognized as percent. But it's still not working, still doesn't pick up Discount as a percent... I don't know why.
I created a new field where discount is shown as a fraction (so obviously DB knows it's a percentage, it just won't let it function as percentage.)

So I tried
Order Total:[Selling Price]*[Quantity]-[discountpct]
That's not working. For some reason it's adding the discount instead of subtracting to the total cost.

So, I figure if doing -[discountpct] adds the discount, then +[discountpct] should subtract it. No, it doesn't. It doesn't change anything, it's as if that's not even in there.

So then I started sticking in random functions in hopes something would work. Nothing's working.

Can someone please give me a hint how to do percentage? Please for the love of god, I don't understand... I'm an Arts student; the left side of my brain has atrophied.

Holy Knight
February 7th, 2007, 10:31 AM
Do you have the initial discount percentage or do you have to find it?

It seems as though you have to do discount*100 to get the actual percentage. So if you have 0.05 it would give 5%.

An easier way of calculating would be [(Selling price)*(100% - Discount%)]*(quantity)

Otherwise, what you're doing is: [(selling price)*quantity] - [Discount*quantity*(selling price)] = price of the discount --> (Selling price)*(quantity) - (Disc. Price)*(quantity)

So sorry, I'm not sure I understand your request.

Suiko Eiji
February 7th, 2007, 11:15 AM
By AccessDB, I assume you mean Microsoft Access?

If your discount is already stored as a finite percentage (ie, not varying depending on quantity), the best way I know to set it up would be

TOTAL=[(Selling Price)-(Selling Price * Discount)]*[Quantity]

Oh, and if you're having trouble getting the arithmetic to work be glad you're not having to toy around with relational algebra.

Tenou
February 7th, 2007, 04:44 PM
By AccessDB, I assume you mean Microsoft Access?

If your discount is already stored as a finite percentage (ie, not varying depending on quantity), the best way I know to set it up would be

TOTAL=[(Selling Price)-(Selling Price * Discount)]*[Quantity]

Oh, and if you're having trouble getting the arithmetic to work be glad you're not having to toy around with relational algebra.
That didn't work either. But...

[Selling Price]*[Quantity]-(([Selling Price]*[Quantity])*[Discount])

did work... I hate percentage. It never works the way I want it to. I can't wait to see what equations everyone else came up with.

... don't say algebra... it's a nasty word. You know, this is my last year as an undergrad. This was my chosen elective. I though it would be fun.

Actually, as much as I *****, I love this class. And even though I put in 10-12 hours a week on assignments, I like doing them... because if you look at my track record, I'm not known for doing my readings or assignment.

Leader Desslock
February 7th, 2007, 04:57 PM
Assuming your discount value is .05 to represent a 5% discount, wouldn't it be...

Actual Price = Selling Price * (1.00 - Discount)
Total = (Actual Price * Quantity Sold)

Plugging in numbers, let's say you sell 20 of a given item that normally costs $10, but it's at a 15% discount.

The total without the discount would be 20 * $10, or $200.

In formula, that'd be Quantity Sold * (Selling Price) = Total Sales.

Now we factor in the discount. A 15% discount (represented as .15, or 15/100) means that the person will actually pay 85% of the cost. Why? 100% of the cost (full price percentage) - Discount Percentage = Actual Cost, or 100% - 15% = 85%. Reducing that to decimals, 1.00 - .15 = .85.

If our original formula was:

Quantity Sold * (Selling Price) = Total Sales

Then the discount just needs to be applied:

Quantity Sold * (Full Price * (1 - Discount Percentage)) = Total Sales

Notice that this works even if the discount is zero (no discount), since that would mean 1.00 - 0.00 = 1, and the Full Price would be unaffected.

Am I missing anything?

Sauron
February 7th, 2007, 07:13 PM
All of you have the same exact equation so it doesn't really matter much.

Holy & Desslock:
(Price * (1 - Discount))*Qty

Suiko distributed Price:
(Price - Price*Discount)*Qty

Tenou distributed Quantity:
Price*Qty - Price*Discount*Qty

Of course, Discount = .05 (Number) or 5% (Percentage)
I'm pretty sure that this is where you might have had a problem (.05 as a percentage or 5 as a number would have put a kink in your answer) as Suiko's equation will work.

Tenou, Access can be alot of fun. Good luck.