Problems displaying data from 'Customers' database (1 Viewer)

LesMcD

New member
Local time
Today, 04:17
Joined
Apr 24, 2010
Messages
1
I am trying to display fields from Orders, Products and Customers Tables and cannot find the SQL to do it. I want to display the orders a customer has placed but only display the Customer detail once instead of displaying it on every line. Can anyone help? My SQL is below:-

SELECT DISTINCT Orders.Order_No, OrderDetails.Order_No, OrderDetails.Product_No, OrderDetails.Total_Cost, OrderDetails.Quantity, Customers.Customer_L_Name, Customers.Cust_Tel_No, Customers.Cust_Mobile_No, Customers.Cust_Email, Customers.Cust_Add1, Customers.Cust_Add2, Customers.Cust_Add3, Customers.Cust_City, Customers.Cust_Country, Customers.Cust_Postcode, Customers.Cust_F_Name, Products.Book_Title, Products.Author, Products.Publisher, Products.ISBN
FROM ((Orders INNER JOIN OrderDetails ON Orders.Order_No = OrderDetails.Order_No) INNER JOIN Customers ON Orders.Customer_No = Customers.Customer_No) INNER JOIN Products ON OrderDetails.Product_No = Products.Product_No
WHERE (OrderDetails.Order_No = Orders.Order_No) AND (Orders.Customer_No = Customers.Customer_No)
 

Malcy

Registered User.
Local time
Today, 12:17
Joined
Mar 25, 2003
Messages
586
Try setting up a continuous form and put the customer details in the "Header" section of the form then the detail for the actual orders in the "Detail" part of the form. Put your close form command button in the "Footer" section.
The query will always show the customer details on each line since there is no other way a query can handle it (I think!)
HTH
 

Users who are viewing this thread

Top Bottom