Hello
In an MS Acces 2016, I have a Form to search queries between dates.
My union query works well.
I need the total of the column Freq1 to use in a calculated field.
However, I don't know how to calculate with sql the total of the column Feq.
I attach my database and an excel file (zip)with the column /Prc) that I need in my query
Your help is appreciated
HTML Code:
SELECT tbltaskmod.day, tbltaskmod.plot_id AS plot, tbltaskmodname.taskmodname AS taskmod, Sum(tbltaskmod.qty) AS Freq1FROM tbltaskmodname INNER JOIN (tblplot INNER JOIN tbltaskmod ON tblplot.Loteid = tbltaskmod.plot_id) ON tbltaskmodname.taskmod_id = tbltaskmod.taskmodname_idGROUP BY tbltaskmod.day, tbltaskmod.plot_id, tbltaskmodname.taskmodnameHAVING (((tbltaskmod.day) Between [Formularios]![frm_qrys_charts]![txtday1] And [Formularios]![frm_qrys_charts]![txtday2]))UNION SELECT tblbtask.day, tblbtask.plot_id AS plot, tblbtask_name.btask_name AS btast, Sum(tblbtask.qty) AS Freq2FROM tblbtask_name INNER JOIN (tblplot INNER JOIN tblbtask ON tblplot.Loteid = tblbtask.plot_id) ON tblbtask_name.btask_id = tblbtask.btask_idGROUP BY tblbtask.day, tblbtask.plot_id, tblbtask_name.btask_nameHAVING (((tblbtask.day) Between [Formularios]![frm_qrys_charts]![txtday1] And [Formularios]![frm_qrys_charts]![txtday2]));