southernweyr
Programmer
I have two tables. One for previous time in make & model and one for adding new time (flightdata). I have a query that will get the sum of time from flightdata for each make & model and another query that adds the make&modelnewtotals total to the time from previousmake&model. The problem I have is that if there is not an excact match it won't display the total from previousmake&model.
flightdata has these make & models: R44 & 269C
so the query (make&modelnewtotals) only returns R44 & 269C
previousmake&model has R22, R44, and 269C and their totals
so the query (make&modeltotal) returns totals for only R44 and 269C.
Also I would like it to return a total if [A/C Make&Model] is like previousmake&model.[A/C Make&Model] instead of an excact match.
make&modelnewtotals
make&modeltotals
flightdata has these make & models: R44 & 269C
so the query (make&modelnewtotals) only returns R44 & 269C
previousmake&model has R22, R44, and 269C and their totals
so the query (make&modeltotal) returns totals for only R44 and 269C.
Also I would like it to return a total if [A/C Make&Model] is like previousmake&model.[A/C Make&Model] instead of an excact match.
make&modelnewtotals
Code:
SELECT flightdata.[A/C Make&Model] AS Expr1, Sum(flightdata.[Total Time]) AS Total
FROM flightdata
GROUP BY flightdata.[A/C Make&Model];
Code:
SELECT [make&modelnewtotals].Expr1, Sum(nz([make&modelnewtotals].Total)+nz(previousmakemodel.[Total Time],0)) AS totalmodel
FROM previousmakemodel INNER JOIN [make&modelnewtotals] ON previousmakemodel.[A/C Make&Model] = [make&modelnewtotals].Expr1
GROUP BY [make&modelnewtotals].Expr1;