Below is the code that I have for a query. It is a Union query. I am try to display two three columns.
Date, Leak Totals, WU Totals.
The code below is showing two columns.
Date, Leak Totals
It is giving me the WU Totals but in the same column as the Leak Totals. What am I doing wrong?
Date, Leak Totals, WU Totals.
The code below is showing two columns.
Date, Leak Totals
It is giving me the WU Totals but in the same column as the Leak Totals. What am I doing wrong?
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
UNION ALL
SELECT
vTbl.Month, Count(*) AS [WU Totals]
FROM
(SELECT DISTINCT Format(TodaysDate,'yyyy-mm-dd') AS [Month], 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.Month;