im have tables in access,Customer,Products and Order Table...
Customer Table:
-
Cust_ICNumber (PK)
-
Cust_Name
-
Cust_Address
-
Cust_PrimaryNumber
-
Cust_SecondaryNumber
-
Cust_Company
-
Cust_CompanyType
-
Products Table
-
Product_ID (PK)
-
Product_Name
-
Product_Price
-
Product_Picture
-
Order Table
-
Order_ID(PK)
-
Product_ID(FK)
-
Order_Quantity
-
Order_Date
-
Customer_ICNumber (FK)
-
Total_Price
-
I intend to output bill (a classic asp file) from order table which will display Order ID,Product Name,Product Price, Customer Name,Customer Address,Order Date.
I wondering if this sql is correct
-
SELECT tCustomer.Cust_Name, tCustomer.Cust_Address, tProducts.Product_Name,tOrder.Order_Quantity, tOrder.Order_Date,tOrder.Order_ID, tOrder_Total_Price FROM (((Order AS tOrder LEFT JOIN Customer AS tCustomer ON tOrder.Customer_ICNumber = tCustomer.Cust_ICNumber) LEFT JOIN Products AS tProducts ON tOrder.Product_ID = tProducts.Product_ID);
-
Another question is do i need to create the relationship in the database when using classic asp...Sorry for this question,i know it is sound silly but i just want to confirm it as im very new at this.