B
blueboy1894
Hi
I have a database with several total queries which eventually need to be
compared, and the differences between the summed Quantities displayed on a
report. The structure of all the data tables (tblprep1, tblprep2 and so on)
is the same and the SQL for each total query looks, for example like this:
SELECT tblprep1.Field4 AS Product, Sum(tblprep1.Field6) AS Quantity,
tblprep1.Field10 AS Prod_Grp, First(tblprep1.Field5) AS Description
FROM tblprep1
GROUP BY tblprep1.Field4, tblprep1.Field10
HAVING (((tblprep1.Field10)="PREPSALADS" Or (tblprep1.Field10)="PREPFRUIT"
Or (tblprep1.Field10)="PREPVEG" Or (tblprep1.Field10)="JUICES"));
How do I go about writing a subquery which allows me to determine the
difference between, for example, the summed quantity in this query, and the
summed quantity in a query for tblprep2?
Any help much appreciated.
I have a database with several total queries which eventually need to be
compared, and the differences between the summed Quantities displayed on a
report. The structure of all the data tables (tblprep1, tblprep2 and so on)
is the same and the SQL for each total query looks, for example like this:
SELECT tblprep1.Field4 AS Product, Sum(tblprep1.Field6) AS Quantity,
tblprep1.Field10 AS Prod_Grp, First(tblprep1.Field5) AS Description
FROM tblprep1
GROUP BY tblprep1.Field4, tblprep1.Field10
HAVING (((tblprep1.Field10)="PREPSALADS" Or (tblprep1.Field10)="PREPFRUIT"
Or (tblprep1.Field10)="PREPVEG" Or (tblprep1.Field10)="JUICES"));
How do I go about writing a subquery which allows me to determine the
difference between, for example, the summed quantity in this query, and the
summed quantity in a query for tblprep2?
Any help much appreciated.