I have a query that will be assisting me find pricing based upon quantity ranges of specific equiment for a given FY.
I'm no access expert, and I keep getting "You tried to execure a query that does not include the specified expression...as part of an aggregate function".
I have tried several things, but cannot seem to figure this one out.
The SQL of my query is as follows:
SELECT IIf(Nz(Sum([Current Orders]![Quantity]))+Nz([forms]![04c Test Query for ROM Support]![Quantity]) Between 1 And 4,[04b Pricing Products]![01-04],IIf(Nz(Sum([Current Orders]![Quantity]))+Nz([forms]![04c Test Query for ROM Support]![Quantity]) Between 5 And 10,[04b Pricing Products]![05-10],IIf(Nz(Sum([Current Orders]![Quantity]))+Nz([forms]![04c Test Query for ROM Support]![Quantity]) Between 11 And 25,[04b Pricing Products]![11-25],IIf(Nz(Sum([Current Orders]![Quantity]))+Nz([forms]![04c Test Query for ROM Support]![Quantity]) Between 26 And 50,[04b Pricing Products]![26-50],IIf(Nz(Sum([Current Orders]![Quantity]))+Nz([forms]![04c Test Query for ROM Support]![Quantity]) Between 51 And 100,[04b Pricing Products]![51-100],IIf(Nz(Sum([Current Orders]![Quantity]))+Nz([forms]![04c Test Query for ROM Support]![Quantity])>100,[04b Pricing Products]![101+])))))) AS Price
FROM [Current Orders], [04a Pricing Fiscal Years] INNER JOIN [04b Pricing Products] ON [04a Pricing Fiscal Years].[Fiscal Year] = [04b Pricing Products].[Fiscal Year]
WHERE ((([Current Orders].Status) Like "Awaiting" & "*") AND (([Current Orders].Nomenclature) Like "*" & [Forms]![04c Test Query for ROM Support]![Nomenclature] & "*") AND (([Current Orders].[Part Number]) Like "*" & [forms]![04c Test Query for ROM Support]![Part Number] & "*") AND (([04b Pricing Products].[Fiscal Year]) Like "*" & [Forms]![04c Test Query for ROM Support]![Fiscal Year] & "*"));
I'm no access expert, and I keep getting "You tried to execure a query that does not include the specified expression...as part of an aggregate function".
I have tried several things, but cannot seem to figure this one out.
The SQL of my query is as follows:
SELECT IIf(Nz(Sum([Current Orders]![Quantity]))+Nz([forms]![04c Test Query for ROM Support]![Quantity]) Between 1 And 4,[04b Pricing Products]![01-04],IIf(Nz(Sum([Current Orders]![Quantity]))+Nz([forms]![04c Test Query for ROM Support]![Quantity]) Between 5 And 10,[04b Pricing Products]![05-10],IIf(Nz(Sum([Current Orders]![Quantity]))+Nz([forms]![04c Test Query for ROM Support]![Quantity]) Between 11 And 25,[04b Pricing Products]![11-25],IIf(Nz(Sum([Current Orders]![Quantity]))+Nz([forms]![04c Test Query for ROM Support]![Quantity]) Between 26 And 50,[04b Pricing Products]![26-50],IIf(Nz(Sum([Current Orders]![Quantity]))+Nz([forms]![04c Test Query for ROM Support]![Quantity]) Between 51 And 100,[04b Pricing Products]![51-100],IIf(Nz(Sum([Current Orders]![Quantity]))+Nz([forms]![04c Test Query for ROM Support]![Quantity])>100,[04b Pricing Products]![101+])))))) AS Price
FROM [Current Orders], [04a Pricing Fiscal Years] INNER JOIN [04b Pricing Products] ON [04a Pricing Fiscal Years].[Fiscal Year] = [04b Pricing Products].[Fiscal Year]
WHERE ((([Current Orders].Status) Like "Awaiting" & "*") AND (([Current Orders].Nomenclature) Like "*" & [Forms]![04c Test Query for ROM Support]![Nomenclature] & "*") AND (([Current Orders].[Part Number]) Like "*" & [forms]![04c Test Query for ROM Support]![Part Number] & "*") AND (([04b Pricing Products].[Fiscal Year]) Like "*" & [Forms]![04c Test Query for ROM Support]![Fiscal Year] & "*"));