AnsweredAssumed Answered

Conditional Calculation

Question asked by JohnDevlon on Apr 21, 2013
Latest reply on May 3, 2013 by philmodjunk


Conditional Calculation


     With this post, I would like to ask a question.

     A have a problem with a small project i'm building.

     I have a database with 3 tables: "Basket", "Product items" and "Default baskets".

     The table "Product items", has 3 fields: "ProductID", "ProductName" and "ProductPrice".
     The table "Default baskets", has 4 fields: "DefaultBasketID", "SetName", "BasketPrice" and "ProductID".
     The table "Basket", has 3 fields: "ID", "DefaultBasketID", "ProductID".

     The table "Product items" contains products like a banana, a appel, a waterbottle, ...

     The table "Default baskets" contains several default shopping baskets containing product Items.
     Example: a basket that contains 3 appels and 1 banana.

     The table "Basket" contains a choosen default basket and items picked.

     When creating a new basket, you pick a default basket and add products.

     So far so good.

     Now I need a calculated field that calculates the basket price. The total price is the basket price + all items not in the default list.
     When a default basket has 2 bananas and the real basket has 4 bananas: the total price is the default price of the basket and 2 additional bananas.

     How do I create a calcalution like that?