I am trying to write an query in Microsoft Query and it appears as there is some problem with the aliases but I cannot figure out how to fix it, any help would be highly appreciated!
SELECT item."No_",
item.Description,
ItemLedgerEntry."Location Code",
Sum(ItemLedgerEntry."Remaining Quantity") As Stock,
Sum(bo."Outstanding Quantity") As BackOrder
FROM Nav50.dbo.item item, Nav50.dbo.ItemLedgerEntry ItemLedgerEntry
LEFT OUTER JOIN ( SELECT SalesLine.No_,
Customer.Name, SalesLine."Location Code",
SalesLine."Outstanding Quantity"
FROM Nav50.dbo.Customer Customer, Nav50.dbo.SalesLine SalesLine
WHERE SalesLine."Sell-to Customer No_" = Customer.No_) bo
ON ((item."No_" = bo.No_) AND (ItemLedgerEntry."Location Code" = bo."Location Code"))
WHERE item.No_ = ItemLedgerEntry."Item No_" AND ((ItemLedgerEntry."Location Code"='STHLM') AND (ItemLedgerEntry."Remaining Quantity"<>$0))
GROUP BY item."No_", item.Description, ItemLedgerEntry."Location Code"
The message I am getting is :
The Multi-Part Identifier “item.No_” could not be bound.
instead of using double quotes try using square brackets:
full query that has been updated using
JOINsyntax instead of commas between tables.