Okay, so I have 2 separate reports with 3 columns, these queries count for a sum column based on where the employee works, and who reported/conditioned them.
The following Queries count
Lets say this is the query for Dinner department reporting management
Code:
SELECT reports.cond, Count(reports.cond) AS CountOfcond
FROM reports
WHERE (((reports.condname)="QA-Jennifer" Or (reports.condname)="QA-Jen" Or (reports.condname)="QA-Lauren" Or (reports.condname)="QA-Mary" Or (reports.condname)="QC-Danielle" Or (reports.condname)="QC-Summer" Or (reports.condname)="QA-Nicholas") AND ((reports.condemp)='Michelle' Or (reports.condemp)='Robyn') AND (reports.timestamp Between Eval("[Forms]![frmhome]![sbfrmprint]![txtStart]") And Eval("[Forms]![frmhome]![sbfrmprint]![txtEnd]") ))
GROUP BY reports.cond;
Lets say this is the Lunch Department reporting management
Code:
SELECT reports.cond, Count(reports.cond) AS CountOfcond
FROM reports
WHERE (((reports.condname)="QA-Jennifer" Or (reports.condname)="QA-Jen" Or (reports.condname)="QA-Lauren" Or (reports.condname)="QA-Mary" Or (reports.condname)="QC-Danielle" Or (reports.condname)="QC-Summer" Or (reports.condname)="QA-Nicholas") AND ((reports.condemp)='Jessica' Or (reports.condemp)='Brian' Or (reports.condemp)='Chris') AND (reports.timestamp Between Eval("[Forms]![frmhome]![sbfrmprint]![txtStart]") And Eval("[Forms]![frmhome]![sbfrmprint]![txtEnd]") ))
GROUP BY reports.cond;
On the reports themselves, the following code creates concatrelated data to show all employees in those dept who were reported by the specific dept the reports being pulled from:
So if Lunch Dept reports MGMT and you need the report this runs:
Code:
=ConcatRelated("[condname]","reports","[cond] = '" & [cond] & "' And ([condname]='QA-Jennifer' Or [condname]='QA-Jen' Or [condname]='QA-Lauren' Or [condname]='QA-Mary' Or [condname]='QA-Nicholas' Or [condname]='QC-Danielle' Or [condname]='QC-Summer') AND ([condemp]='Jessica' Or [condemp]='Brian' Or [condemp]='Chris') AND timestamp Between #" & [Forms]![frmhome]![sbfrmprint]![txtStart] & "# And #" & [Forms]![frmhome]![sbfrmprint]![txtEnd] & "#")
And the Dinner Dept report on MGMT:
Code:
=ConcatRelated("[condname]","reports","[cond] = '" & [cond] & "' And ([condname]='QA-Jennifer' Or [condname]='QA-Jen' Or [condname]='QA-Lauren' Or [condname]='QA-Mary' Or [condname]='QA-Nicholas' Or [condname]='QC-Danielle' Or [condname]='QC-Summer') And ([condemp]='Michelle' Or [condemp]='Robyn') AND timestamp Between #" & [Forms]![frmhome]![sbfrmprint]![txtStart] & "# And #" & [Forms]![frmhome]![sbfrmprint]![txtEnd] & "#")
When the reports come up This is what I see on the reports themselves, and I'm having a hard time figuring this out.
Lunch Report:
Dinner Report:
For some reason the Lunch report is picking up the conditions from the dinner report, but doesnt display the name, granted they shouldnt be there at all. any suggestions?