View Full Version : Newbie help needed


Xerox
06-05-2002, 04:51 AM
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
06-05-2002, 05:14 AM
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
06-05-2002, 07:11 AM
Not too worry Colin, I have sorted it out now, thanks for the help anyway.