I have a question about a query I'm trying to do. Below counts the total records such as
SELECT carrier_routes.[Parent Zip], Count(carrier_routes.Route) AS CountOfRoute, Count(logbook.AQRT) AS CountOfAQRT FROM carrier_routes INNER JOIN logbook ON carrier_routes.ID = logbook.ID GROUP BY carrier_routes.[Parent Zip];
Results:
CountOfRoute CountOfAQRT
62 7
However, if I use a Where command to exclude or look for a particular string, it will work but the count for CountOfRoute will change also,
SELECT carrier_routes.[Parent Zip], Count(carrier_routes.Route) AS CountOfRoute FROM carrier_routes INNER JOIN logbook ON carrier_routes.ID = logbook.ID WHERE ((logbook.AQRT)<>"AQRT AMS")) GROUP BY carrier_routes.[Parent Zip];
CountOfRoute CountOfAQRT
6 6
I need to keep them separate were it will not change the count of te Route;
CountOf Route CountOf AQRT
62 6
Can this be done in one query?
SELECT carrier_routes.[Parent Zip], Count(carrier_routes.Route) AS CountOfRoute, Count(logbook.AQRT) AS CountOfAQRT FROM carrier_routes INNER JOIN logbook ON carrier_routes.ID = logbook.ID GROUP BY carrier_routes.[Parent Zip];
Results:
CountOfRoute CountOfAQRT
62 7
However, if I use a Where command to exclude or look for a particular string, it will work but the count for CountOfRoute will change also,
SELECT carrier_routes.[Parent Zip], Count(carrier_routes.Route) AS CountOfRoute FROM carrier_routes INNER JOIN logbook ON carrier_routes.ID = logbook.ID WHERE ((logbook.AQRT)<>"AQRT AMS")) GROUP BY carrier_routes.[Parent Zip];
CountOfRoute CountOfAQRT
6 6
I need to keep them separate were it will not change the count of te Route;
CountOf Route CountOf AQRT
62 6
Can this be done in one query?