Hi,
I have created a query in Access and am trying to get MS Query to use the SQL to get data into my spreadsheet.
It works fine in Access and I cannot for the life of me figure out what the problem is in MS Query!
It says "Too few parameters. Expected 3."
SELECT `Ahr1002-AUS`.`Order Sales Rep`, `Ahr1002-AUS`.`Sales Order`, `Ahr1002-AUS`.`Delivery Date`, `Ahr1002-AUS`.`Line Status`, `Ahr1002-AUS`.`Sales Class`, Sum(`Ahr1002-AUS`.`Outstanding Amount`) AS `SumOfOutstanding Amount`, Max(`Ahr1002-AUS`.`Customer Code`) AS `MaxOfCustomer Code`, Max(`Ahr1002-AUS`.`Customer Name`) AS `MaxOfCustomer Name`, Max(`Ahr1002-AUS`.`Order Date`) AS `MaxOfOrder Date`, Min(`Ahr1002-AUS`.`Promised Date`) AS `MinOfPromised Date`, Max(`Ahr1002-AUS`.`Desp Warehouse`) AS `MaxOfDesp Warehouse`, Max(`Ahr1002-AUS`.`Sell Warehouse`) AS `MaxOfSell Warehouse`, Max(`Ahr1002-AUS`.Product) AS MaxOfProduct, Max(`Ahr1002-AUS`.Description) AS MaxOfDescription, Max(`Ahr1002-AUS`.`Purchase Order`) AS `MaxOfPurchase Order`, Sum(`Ahr1002-AUS`.`Order Quantity`) AS `SumOfOrder Quantity`, Sum(`Ahr1002-AUS`.`Shipped Quantity`) AS `SumOfShipped Quantity`, Sum(`Ahr1002-AUS`.`Outstanding Quantity`) AS `SumOfOutstanding Quantity`, Max(`Ahr1002-AUS`.`Product Group`) AS `MaxOfProduct Group`, Max(`Ahr1002-AUS`.`Sales Class Description`) AS `MaxOfSales Class Description`, Max(`Ahr1002-AUS`.Status) AS MaxOfStatus, Sum(`Ahr1002-AUS`.`Unit Cost`) AS `SumOfUnit Cost`, Sum(`Ahr1002-AUS`.`Outstanding Cost`) AS `SumOfOutstanding Cost`, Max(`Ahr1002-AUS`.Currency) AS MaxOfCurrency, Max(`Ahr1002-AUS`.`Exchange Rate`) AS `MaxOfExchange Rate`
FROM `ahr1002-AUS.txt` `ahr1002-AUS`
GROUP BY `Ahr1002-AUS`.`Order Sales Rep`, `Ahr1002-AUS`.`Sales Order`, `Ahr1002-AUS`.`Delivery Date`, `Ahr1002-AUS`.`Line Status`, `Ahr1002-AUS`.`Sales Class`
HAVING (((Left(`Sales Class`,4))=`SE05`)) OR (((Max(Left(`Order Sales Rep`,2)))>`68` And (Max(Left(`Order Sales Rep`,2)))<`90`));
Any ideas?
Bookmarks