Newbie help needed (2 Viewers)

Xerox

New member
Local time
Today, 11:50
Joined
Jun 5, 2002
Messages
5
I have a an indentical database like northwind except that I have weights that are needed to calcuate the extendedprice.But I have a couple of products that have no weight associated to it and hence need the extended price to be calucated differently for example:

If Weightlb > 0 then
ExtendedPrice = Quantity * Weight * Price
Else
ExtendedPrice = Quantity * Price
EndIF
Something along these lines, but I do not know how I can set this up, can anyone help please?? Many thanks in advance
 

ColinEssex

Old registered user
Local time
Today, 11:50
Joined
Feb 22, 2002
Messages
9,116
Assuming that the price is per lb and that the weight will always be in exact lb's then the extended price for the weight is as you say

ExtendedPrice = [Quantity] * [Weightlb] * [Price]

this is where the where the weight is > 0

however, if you have no weight (0) you are assuming that the weight is 1lb in your calculation by multiplying that by [Quantity]

Could you explain the pricing? I can't quite work out how you can have a price per lb if you have no weight included.

Col
 

Xerox

New member
Local time
Today, 11:50
Joined
Jun 5, 2002
Messages
5
Not too worry Colin, I have sorted it out now, thanks for the help anyway.
 

Users who are viewing this thread

Top Bottom