Hi, I am a beginner to SQL. I am trying to write a VB .Net program to display data from the generic Northwind Traders database. I have a datagrid displaying the customer data, then I have another datagrid displaying fields from the Orders, Order Detail and Product tables. My problem is trying to get the last part of attaching the Product Name to the Part Number. Here is the syntax:
SELECT
Orders.CustomerID,
Orders.OrderID,
Orders.OrderDate,
[Order Details].OrderID as Expr1,
[Order Details].ProductID,
[Order Details].Quantity,
[Order Details].UnitPrice,
[Order Details].Discount,
Products.ProductName
FROM
Orders
INNER JOIN [Order Details) ON
Orders.OrderID = [Order Details].OrderID
INNER JOIN Products ON
[Order Details].ProductID = Products.ProductID
The syntax error I am getting is:
Syntax error (missing operator) in query expression 'Orders.OrderID = [Order Details].OrderID
INNER JOIN Products ON [Order Details].ProductID = Products.ProductID'.
I have no idea what operator is missing. Any help would be greatly appreciated.
Now, when I remove the Products table and last INNER JOIN, it works fine. Is there a limit on INNER JOINS?
And I apologize if this was not the correct forum for this question.
Thanks in advance,
Rhonda
SELECT
Orders.CustomerID,
Orders.OrderID,
Orders.OrderDate,
[Order Details].OrderID as Expr1,
[Order Details].ProductID,
[Order Details].Quantity,
[Order Details].UnitPrice,
[Order Details].Discount,
Products.ProductName
FROM
Orders
INNER JOIN [Order Details) ON
Orders.OrderID = [Order Details].OrderID
INNER JOIN Products ON
[Order Details].ProductID = Products.ProductID
The syntax error I am getting is:
Syntax error (missing operator) in query expression 'Orders.OrderID = [Order Details].OrderID
INNER JOIN Products ON [Order Details].ProductID = Products.ProductID'.
I have no idea what operator is missing. Any help would be greatly appreciated.
Now, when I remove the Products table and last INNER JOIN, it works fine. Is there a limit on INNER JOINS?
And I apologize if this was not the correct forum for this question.
Thanks in advance,
Rhonda