So, lets say I have 3 tables.
First table is the product table where it consists of
Prod_code, Prod_name, Prod_qty, Prod_Price1, Prod_Price2.
The second table is the Order table where it consists of
Order_ID, Order_Date, Total_price.
And the last table is the order detail table which consists of
Order_Detail_ID, Order_ID (foreign key from order table), Prod_code(foreign key from Product table), Qty_Ordered, and Price
If you can see I have 2 prices for each product in the product table for the purpose of:
- If the Qty_ordered from the order detail table is greater than 10 unit, then the Price column in the order detail given will be Prod_price2
- If the Qty_ordered from the order detail table is equal to or less than 10 unit, then Price column in the order detail given will be Prod_price1
How can I make this happen so when I create an order detail form, it can automatically give me the Product price based on the Qty_ordered that I input?
I believe this could require some if statements in the query but I'm a novice in Ms. Access and I need you guys' help. Thanks a lot
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…