Using the query below, I am interested in extracting all records from the "CostPerUnit_Supplies" table that have two or more CostPerUnit fields populated and have a different cost per unit in one or more of the following six fields;
Supplies-Jan2007_CostPerUnit
Supplies-Feb2007_CostPerUnit
Supplies-March2007_CostPerUnit
Supplies-Jan2008_CostPerUnit
Supplies-Feb2008_CostPerUnit
Supplies-March2008_CostPerUnit.
Note, the CostPerUnit values should be the same. I am designing the query to extract all exceptions to this rule.
What modifications are needed in the query below that will allow the extraction of records that meet the abovementioned criteria?
SELECT CostPerUnit_Supplies.[_PROV_FULL_NM_CostPerUnit] AS Expr1
, CostPerUnit_Supplies.PROC_CODE_CostPerUnit AS Expr2
, CostPerUnit_Supplies.PROC_DESC_CostPerUnit AS Expr3
, CostPerUnit_Supplies.[Supplies-Jan2007_CostPerUnit] AS Expr4
, CostPerUnit_Supplies.[Supplies-Feb2007_CostPerUnit] AS Expr5
, CostPerUnit_Supplies.[Supplies-Mar2007_CostPerUnit] AS Expr6
, CostPerUnit_Supplies.[Supplies-Jan2008_CostPerUnit] AS Expr7
, CostPerUnit_Supplies.[Supplies-Feb2008_CostPerUnit] AS Expr8
, CostPerUnit_Supplies.[Supplies-Mar2008_CostPerUnit] AS Expr9
FROM CostPerUnit_Supplies
WHERE ((([CostPerUnit_Supplies].[Supplies-Feb2007_CostPerUnit])<>"Supplies-Jan2007_CostPerUnit")
AND (([CostPerUnit_Supplies].[Supplies-Mar2007_CostPerUnit])<>"Supplies-Jan2007_CostPerUnit"))
OR ((([CostPerUnit_Supplies].[Supplies-Feb2007_CostPerUnit])<>"Supplies-Mar2007_CostPerUnit")
AND (([CostPerUnit_Supplies].[Supplies-Mar2007_CostPerUnit])<>"Supplies-Feb2007_CostPerUnit"));
Supplies-Jan2007_CostPerUnit
Supplies-Feb2007_CostPerUnit
Supplies-March2007_CostPerUnit
Supplies-Jan2008_CostPerUnit
Supplies-Feb2008_CostPerUnit
Supplies-March2008_CostPerUnit.
Note, the CostPerUnit values should be the same. I am designing the query to extract all exceptions to this rule.
What modifications are needed in the query below that will allow the extraction of records that meet the abovementioned criteria?
SELECT CostPerUnit_Supplies.[_PROV_FULL_NM_CostPerUnit] AS Expr1
, CostPerUnit_Supplies.PROC_CODE_CostPerUnit AS Expr2
, CostPerUnit_Supplies.PROC_DESC_CostPerUnit AS Expr3
, CostPerUnit_Supplies.[Supplies-Jan2007_CostPerUnit] AS Expr4
, CostPerUnit_Supplies.[Supplies-Feb2007_CostPerUnit] AS Expr5
, CostPerUnit_Supplies.[Supplies-Mar2007_CostPerUnit] AS Expr6
, CostPerUnit_Supplies.[Supplies-Jan2008_CostPerUnit] AS Expr7
, CostPerUnit_Supplies.[Supplies-Feb2008_CostPerUnit] AS Expr8
, CostPerUnit_Supplies.[Supplies-Mar2008_CostPerUnit] AS Expr9
FROM CostPerUnit_Supplies
WHERE ((([CostPerUnit_Supplies].[Supplies-Feb2007_CostPerUnit])<>"Supplies-Jan2007_CostPerUnit")
AND (([CostPerUnit_Supplies].[Supplies-Mar2007_CostPerUnit])<>"Supplies-Jan2007_CostPerUnit"))
OR ((([CostPerUnit_Supplies].[Supplies-Feb2007_CostPerUnit])<>"Supplies-Mar2007_CostPerUnit")
AND (([CostPerUnit_Supplies].[Supplies-Mar2007_CostPerUnit])<>"Supplies-Feb2007_CostPerUnit"));