Below is the sql I have for a query. This works good. What
I would like to add is another Column for Grand Total that
would equal the total of each of the items I am querying
in the query. How can I accomplish this?
I would like to add is another Column for Grand Total that
would equal the total of each of the items I am querying
in the query. How can I accomplish this?
Code:
SELECT Sum(IIf(([ObserversSecondTbl].[PPEEyeProSafe]=True),1,0)) AS Eye, Sum(IIf(([ObserversSecondTbl].[PPEFaceProSafe]=True),1,0)) AS Face, Sum(IIf(([ObserversSecondTbl].[PPEHeadProSafe]=True),1,0)) AS Head, Sum(IIf(([ObserversSecondTbl].[PPEEarProSafe]=True),1,0)) AS Ear, Sum(IIf(([ObserversSecondTbl].[PPERespiratoryProSafe]=True),1,0)) AS Respiratory, Sum(IIf(([ObserversSecondTbl].[PPEHandProSafe]=True),1,0)) AS Hand, Sum(IIf(([ObserversSecondTbl].[PPEBodyProSafe]=True),1,0)) AS Body, Sum(IIf(([ObserversSecondTbl].[PPEFootProSafe]=True),1,0)) AS Foot
FROM ObserversMainResultsTbl INNER JOIN ObserversSecondTbl ON ObserversMainResultsTbl.FormNbr = ObserversSecondTbl.FormNbr
WHERE (((ObserversMainResultsTbl.Date) Between [Forms]![LiftsQueriesReports]![StartDateTxt] And [Forms]![LiftsQueriesReports]![EndDateTxt]));