jamescullis
Registered User.
- Local time
- Tomorrow, 05:43
- Joined
- Jun 2, 2014
- Messages
- 38
Hi all, I need help with calculating a field value please.
I've got 5 products, numbered 1 - 5 in tblProducts.productID
In one order I'll only ever have the 1 - 5 products, with a maximum of 5 products in any Order.
products
1 = mushroom
2 = tomato
3 = egg
4 = fish
5 = meat
tblOrder.orderID
tblOrderDetail.productID
I have a field in tblOrderDetail called "productNumber" which is where the result should go of the calculation.
I need to calculate the total number of products ordered but it could be a combination of them, the thing is that I need to reference them in a specific order if they exist in the order as per the schedule above.
example
order 1 = products 1,3,4
the result should be
1.3 (mushroom)
2.3 (egg)
3.3 (fish)
example 2
order 2 = products 1,4
the result should be
1.2 (mushroom)
2.2 (fish)
example 3
order 3 = products 4,1 (this one shows that we haven't ordered it in order, I still need to display that correct order)
the result should be
1.2 (mushroom)
2.2 (fish)
any mathematicians out there?
* also may be the wrong forum sorry
I've got 5 products, numbered 1 - 5 in tblProducts.productID
In one order I'll only ever have the 1 - 5 products, with a maximum of 5 products in any Order.
products
1 = mushroom
2 = tomato
3 = egg
4 = fish
5 = meat
tblOrder.orderID
tblOrderDetail.productID
I have a field in tblOrderDetail called "productNumber" which is where the result should go of the calculation.
I need to calculate the total number of products ordered but it could be a combination of them, the thing is that I need to reference them in a specific order if they exist in the order as per the schedule above.
example
order 1 = products 1,3,4
the result should be
1.3 (mushroom)
2.3 (egg)
3.3 (fish)
example 2
order 2 = products 1,4
the result should be
1.2 (mushroom)
2.2 (fish)
example 3
order 3 = products 4,1 (this one shows that we haven't ordered it in order, I still need to display that correct order)
the result should be
1.2 (mushroom)
2.2 (fish)
any mathematicians out there?
* also may be the wrong forum sorry
Last edited: