Hello.
I am trying to a union query with three queries.
In the following SQL code, the first two queries run well.
Code:
SELECT tblA.ddate, Format(Sqr([qty_hrs]),"Standard") AS rc, Format(Sum([qty]*8),"Standard") AS total_hoursFROM tblA
GROUP BY tblA.ddate
UNION
SELECT tblB.ddate, Format(Sqr([qty_hrs]),"Standard") AS rc, Format(Sum([qty]*8),"Standard") AS total_hours
FROM tblB
GROUP BY tblB.ddate;
However, when I add the third SQL MS Access displays this message:
Code:
SELECT tblA.ddate, Format(Sqr([qty_hrs]),"Standard") AS rc, Format(Sum([qty]*8),"Standard") AS total_hoursFROM tblA
GROUP BY tblA.ddate
UNION
SELECT tblB.ddate, Format(Sqr([qty_hrs]),"Standard") AS rc, Format(Sum([qty]*8),"Standard") AS total_hours
FROM tblB
GROUP BY tblB.ddate
UNION
SELECT tblC.date, Format(Sqr([qty_hrs]),"Standard") AS rc, Format(Sum(([hr_end]-[hr_beg])*24),"Standard") AS total_hours
FROM tblC
GROUP BY tblC.ddate;
"Invalid procedure call"
I think my problem is in the "rc" calculation of the third query.
If so, I really appreciate any help to reformulate the "rc" recalculation in the third query.
Cheers