I have two queries that I want to combine. See code below:
The first query gives me a total of how many leaks there
were by day.
The second query give me a total of how many WorkUnits there
were by day.
When I combine the two I only want to see the date once and
then the Leak totals and WorkUnit totals. I am thankful for
all advice and help. I am also open to other ways to get
the info I need.
The first query gives me a total of how many leaks there
were by day.
The second query give me a total of how many WorkUnits there
were by day.
When I combine the two I only want to see the date once and
then the Leak totals and WorkUnit totals. I am thankful for
all advice and help. I am also open to other ways to get
the info I need.
Date LeakTotals WUTotals
05/27/08 6 49
Code:
SELECT
Format(TodaysDate,'yyyy-mm-dd') AS [Date],
Count(*) AS [Leak Totals]
FROM
WorkUnitsFaultsMainTBL
WHERE
(((WorkUnitsFaultsMainTBL.Problem) Like "*leak*")
AND
((WorkUnitsFaultsMainTBL.TodaysDate) Between [Forms]![Queries_ReportsFRM]![StartDateTxt] And [Forms]![Queries_ReportsFRM]![EndDateTxt])
AND
((WorkUnitsFaultsMainTBL.BuildID) In ("E010","C809","F001","C810","F187","A910","M173","M174")))
GROUP BY
Format(TodaysDate,'yyyy-mm-dd')
ORDER BY
Format(TodaysDate,'yyyy-mm-dd'), Count(*) DESC;
Code:
SELECT vTbl.Day,
Count(*) AS [WU Totals]
FROM
(SELECT DISTINCT Format(TodaysDate,'yyyy-mm-dd') AS [Day], WorkUnit
FROM
WorkUnitsFaultsMainTBL
WHERE
BuildID IN ('E010','C809','F001','C810','F187','A910','M173','M174')
AND
PossibleCause <> 'Out of Stock'
AND
(TodaysDate BETWEEN [Forms]![Queries_ReportsFRM]![StartDateTxt] And [Forms]![Queries_ReportsFRM]![EndDateTxt])) AS vTbl
GROUP BY
vTbl.Day;