Select with multiple queries problem
I currently have an access query that pulls data from four other queries. Each query counts the same column from the same table with different where criteria. I want to know if I can use just one single query to combine the functionality of all these queries.
I want to select a system_no and count the asset column of this table based on the where certain fields are whatever then select the system_no and count the asset column again but use different where criteria. I hope someone can help me out. I thank all that can help.
One query is:
SELECT ACP_Assets.SYSTEM_NO, Count(ACP_Assets.TPLNR) AS FLOC_Complete
FROM ACP_Assets INNER JOIN Assets ON ACP_Assets.TPLNR = Assets.Asset
WHERE ((((ACP_Assets.Status)<>"INAK" And (ACP_Assets.Status)<>"DLFL") AND ((Assets.ER_Type)>0 And (Assets.ER_Type) Is Not Null) AND ((Assets.Criteria_ModifiedBy)<>"79294" And (Assets.Criteria_ModifiedBy)<>"79297") AND ((Assets.Status)<>"NotInSAP")) OR (((ACP_Assets.Status) Is Null) AND ((Assets.ER_Type)>0 And (Assets.ER_Type) Is Not Null) AND ((Assets.Criteria_ModifiedBy)<>"79294" And (Assets.Criteria_ModifiedBy)<>"79297") AND ((Assets.Status)<>"NotInSAP")))
GROUP BY ACP_Assets.SYSTEM_NO
Another is:
SELECT ACP_Assets.SYSTEM_NO, Count(ACP_Assets.TPLNR) AS FLOC_SystemTotal
FROM ACP_Assets INNER JOIN Assets ON ACP_Assets.TPLNR = Assets.Asset
WHERE ((((ACP_Assets.Status)<>"INAK" And (ACP_Assets.Status)<>"DLFL") AND ((Assets.Status)<>"NotInSAP")) OR (((ACP_Assets.Status) Is Null) AND ((Assets.Status)<>"NotInSAP")))
GROUP BY ACP_Assets.SYSTEM_NO;
There are two more but the I have a query that takes the SYSTEM_NO from the first and the FLOC_Complete and the FLOC_SystemTotal from the second where the two queries are inner joined based on the SYSTEM_NO
|