TeeSee said:
Peter said:
TeeSee wrote:
The following is a calculated field called "Markup" ... Markup:
(([NetSell]/[IPR])/([NetCost]))-1.
NetSell and NetCost are also calculated fields.
How can I set the criteria in the query grid to find Markup of less
than 25%.
I continually get a wee box asking me to "enter parameter value" for
NetSell and NetCost.
Use the formulas instead of aliases:
Markup: (((FormulaToCreateNetSell)/[IPR])/((FormulaToCreateNetCost)))-1
Thanks Peter .... Have done that but now get the same wee box asking
for parameter values for fields within the formulae. The following is
the criteria with the formulae inserted as suggested. Calculated Sell,
CalculatedNet and LDCost ..... are all calculated fields.
((IIf([CurrSellPrice]=0,[CalculatedSell],[CurrSellPrice])/[IPR])/
(IIf([LDCostPerInvUnit]=0,[CalculatedNet],[LDCostPerInvUnit]))-1)<0.25
Review all field names again. If you are asked for parameters you have
either mistyped a field name or you still use an alias rather than a field
name. If you don't find it, post the entire SQL string.
Peter was unable to find my error. Here is the SQL.
SELECT tblMaterialMaster.ManufacturerName,
tblMaterialMaster.ManufacturerNo, tblMaterialMaster.SISItemCode,
tblMaterialMaster.[Material description], tblMaterialMaster.ListPrice,
tblMaterialMaster.InvUnit, tblCustomerItems.SellUnit,
tblCustomerItems.SellDiscFromList, tblMaterialMaster.Discount,
tblCustomerItems.XtraDiscount, tblMaterialMaster.CostPerInvUnit,
tblCustomerItems.CurrSellPrice, tblMaterialMaster.UpdateDate,
tblCustomerItems.PriceDate, tblCustomerItems.IPR,
tblExRate.ExchangeRate, IIf([ListPrice]=0,0,IIf([Funds]="USD",
(([ListPrice]-([ListPrice]*[Discount]))*(1-[XtraDiscount])*(1+
[ExchangeRate])),([ListPrice]-([ListPrice]*[Discount]))*(1-
[XtraDiscount]))) AS CalculatedNet, IIf([Funds]="USD",
(([CostPerInvUnit]*(1-[XtraDiscount]))*(1+[ExchangeRate])),
[CostPerInvUnit]) AS LDCostPerInvUnit, IIf([LDCostPerInvUnit]=0,
[CalculatedNet],[LDCostPerInvUnit]) AS NetCost, (([NetSell]/[IPR])/
([NetCost]))-1 AS Markup, [Markup]/([Markup]+1) AS Margin,
IIf([Funds]="CAN",(([ListPrice]-
([ListPrice]*[SellDiscFromList]))*[IPR]),((([ListPrice]-
([ListPrice]*[SellDiscFromList]))*(1+[ExchangeRate])))*[IPR]) AS
CalculatedSell, IIf([CurrSellPrice]=0,[CalculatedSell],
[CurrSellPrice]) AS NetSell, tblMaterialMaster.LocalGroup,
tblCustomerItems.CustomerIDCode, tblMaterialMaster.Funds,
tblCustomerItems.CustItemCode, tblCustomerItems.ContractItem,
tblMaterialMaster.Inactive, tblCustomerItems.ActiveYN,
tblULFC.ExpDescript
FROM tblExRate, (tblMaterialMaster INNER JOIN tblCustomerItems ON
tblMaterialMaster.SISItemCode = tblCustomerItems.SISItemCode) INNER
JOIN tblULFC ON tblMaterialMaster.LocalGroup = tblULFC.LocalGroup
WHERE (((tblMaterialMaster.Inactive)=No) AND
((tblCustomerItems.ActiveYN)=No))
ORDER BY tblMaterialMaster.SISItemCode;
Thanks for taking the time.