R
Ron
I am trying to print Invoices
I Have:
Table:
OrderFacts - SKU (PK)(T6) - CustFinOrder (Y/N) - CustFinQty (I) -
CustFinOrdNum (T 999999\-999)
CustDet - OrdID (PK)(AN) - OrderNo (T 999999\-999) - SKU (T6) - QTY
(DG2) -SalePrice (C2) - ExtPrice (C2)
NewItems - SKU (PK)(T6) - Item (T255) - Description (T255)
tblPrices - SKU (T6) - ItemDate (DT) - Min (SGNAuto) - SalePrice (C2)
- MarkUP (SP2)
The items I want in my invoice are:
1. OrderFacts - SKU - CustFinQty - CustFinOrdNum
2. tblPrices - Min - SalePrice - Markup
3. ExtPrice: Min + (Min*MarkUP)
4. NewItems - Description
Append Query:
INSERT INTO [Customer Details] ( [Order#], SKU, SalePrice,
Qty, ExtPrice )
SELECT [Order Facts].CustFinalInvoice, [Order Facts].SKU,
tblPrices.SalePrice, [Order Facts].CustFinalQty, [Min]+([Min]*[Markup]) AS
ExtPrice
FROM [Order Facts] LEFT JOIN tblPrices ON [Order Facts].SKU = tblPrices.SKU
WHERE ((([Order Facts].CustFinalInvoice)=[enter the order number]) AND
(([Order Facts].CustFinalOrder)=Yes));
This Query Works fine to put 1,2 and3 in.
I try to add 4 in the Query Pane and I get this Query:
INSERT INTO [Customer Details] ( [Order#], SKU, SalePrice, Qty,
ExtPrice, Description )
SELECT [Order Facts].CustFinalInvoice, [Order Facts].SKU,
tblPrices.SalePrice, [Order Facts].CustFinalQty, [Min]+([Min]*[Markup]) AS
ExtPrice, tblNewItems.Description
FROM ([Order Facts] LEFT JOIN tblPrices ON [Order Facts].SKU =
tblPrices.SKU) LEFT JOIN tblNewItems ON (tblNewItems.SKU = tblPrices.SKU) AND
(tblNewItems.SKU = tblPrices.SKU) AND (tblNewItems.SKU = tblPrices.SKU) AND
(tblNewItems.SKU = tblPrices.SKU) AND ([Order Facts].SKU = tblNewItems.SKU)
WHERE ((([Order Facts].CustFinalInvoice)=[enter the order number]) AND
(([Order Facts].CustFinalOrder)=Yes));
And the following error:
The SQL statement could not be executed because it contains ambiguous outer
joins. To force one of the joins to be performed first, create a separate
query that performs the first join and then include that query in your SQL
statement.
Can Someone help me with this. Remember I'm new to queries and to put two
queries together just rattles my Jowls. Help sorta confused me
TIA
-
Ron
I Have:
Table:
OrderFacts - SKU (PK)(T6) - CustFinOrder (Y/N) - CustFinQty (I) -
CustFinOrdNum (T 999999\-999)
CustDet - OrdID (PK)(AN) - OrderNo (T 999999\-999) - SKU (T6) - QTY
(DG2) -SalePrice (C2) - ExtPrice (C2)
NewItems - SKU (PK)(T6) - Item (T255) - Description (T255)
tblPrices - SKU (T6) - ItemDate (DT) - Min (SGNAuto) - SalePrice (C2)
- MarkUP (SP2)
The items I want in my invoice are:
1. OrderFacts - SKU - CustFinQty - CustFinOrdNum
2. tblPrices - Min - SalePrice - Markup
3. ExtPrice: Min + (Min*MarkUP)
4. NewItems - Description
Append Query:
INSERT INTO [Customer Details] ( [Order#], SKU, SalePrice,
Qty, ExtPrice )
SELECT [Order Facts].CustFinalInvoice, [Order Facts].SKU,
tblPrices.SalePrice, [Order Facts].CustFinalQty, [Min]+([Min]*[Markup]) AS
ExtPrice
FROM [Order Facts] LEFT JOIN tblPrices ON [Order Facts].SKU = tblPrices.SKU
WHERE ((([Order Facts].CustFinalInvoice)=[enter the order number]) AND
(([Order Facts].CustFinalOrder)=Yes));
This Query Works fine to put 1,2 and3 in.
I try to add 4 in the Query Pane and I get this Query:
INSERT INTO [Customer Details] ( [Order#], SKU, SalePrice, Qty,
ExtPrice, Description )
SELECT [Order Facts].CustFinalInvoice, [Order Facts].SKU,
tblPrices.SalePrice, [Order Facts].CustFinalQty, [Min]+([Min]*[Markup]) AS
ExtPrice, tblNewItems.Description
FROM ([Order Facts] LEFT JOIN tblPrices ON [Order Facts].SKU =
tblPrices.SKU) LEFT JOIN tblNewItems ON (tblNewItems.SKU = tblPrices.SKU) AND
(tblNewItems.SKU = tblPrices.SKU) AND (tblNewItems.SKU = tblPrices.SKU) AND
(tblNewItems.SKU = tblPrices.SKU) AND ([Order Facts].SKU = tblNewItems.SKU)
WHERE ((([Order Facts].CustFinalInvoice)=[enter the order number]) AND
(([Order Facts].CustFinalOrder)=Yes));
And the following error:
The SQL statement could not be executed because it contains ambiguous outer
joins. To force one of the joins to be performed first, create a separate
query that performs the first join and then include that query in your SQL
statement.
Can Someone help me with this. Remember I'm new to queries and to put two
queries together just rattles my Jowls. Help sorta confused me
TIA
-
Ron