G
Gina
I'm sorry if I'm wearing out my welcome...I posted a
similar question before but was told I didn't provide
enough details.
I want a report that lists ALL of our employees and
whether they're eligible for a bonus in any given month.
Bonus eligibility is determined by the number of absences,
tardies, written warnings, and suspensions an employee has
had during the month. I want to the report to include ALL
the employees and their bonus eligibility to give to the
payroll department.
Here's the query the report is based on:
SELECT qryBonusEligReport.Event,
qryBonusEligReport.EventDate, Nz([CtUnexAbs]) AS
CountUnexAbs, Nz([CtTard]) AS CountTard, Nz([CtLtEarly])
AS CountLtEarly, Nz([CtWarn]) AS CountWarn, Date()-
[HireDate] AS DaysEmp, Nz([CtSusp]) AS CountSusp,
EmployeeData.EmployeeName, EmployeeData.HireDate,
EmployeeData.FileNumber, EmployeeData.Department,
EmployeeData.Status, EmployeeData.BonusGroup
FROM EmployeeData LEFT JOIN qryBonusEligReport ON
EmployeeData.EmployeeName =
qryBonusEligReport.EmployeeName;
I have two main tables:
tblEvents tblEmployeeData
FileNumber FileNumber
Event EmployeeName
EventDate Department
EventID HireDate
Status
EmployeeID
I have the query working exactly the way I want it to, and
I have the report already set up. I use a print dialog
form to print the report, and I enter the date range I
want to print on the print dialog form.
Here's a portion of the code:
If (ReptToPrint = 6) Then
DoCmd.OpenReport "rptBonusEligibilityDetail",
acPreview, "", ("([Date]Between Forms![frmPrintReports]!
[txtBegDate] and Forms![frmPrintReports]![txtEndDate]) or
([Date] is Null) ")
End If
The problem arises when I specify the date range. I
included the is Null portion of the where clause so that I
would still be able to get all the employees' names on the
report, whether they've had an absence, tardy, etc. or
not. However, the way I have the clause worded, I get all
the employees with an Event within the date range
specified and those employees with NO Events at all. What
I want is to display ALL the employees, regardless of
whether they have any Events, but if they do have Events I
need to show ONLY the events for the date range I
specified.
I hope I've been able to make myself clearer.
Thanks so much (again)!
similar question before but was told I didn't provide
enough details.
I want a report that lists ALL of our employees and
whether they're eligible for a bonus in any given month.
Bonus eligibility is determined by the number of absences,
tardies, written warnings, and suspensions an employee has
had during the month. I want to the report to include ALL
the employees and their bonus eligibility to give to the
payroll department.
Here's the query the report is based on:
SELECT qryBonusEligReport.Event,
qryBonusEligReport.EventDate, Nz([CtUnexAbs]) AS
CountUnexAbs, Nz([CtTard]) AS CountTard, Nz([CtLtEarly])
AS CountLtEarly, Nz([CtWarn]) AS CountWarn, Date()-
[HireDate] AS DaysEmp, Nz([CtSusp]) AS CountSusp,
EmployeeData.EmployeeName, EmployeeData.HireDate,
EmployeeData.FileNumber, EmployeeData.Department,
EmployeeData.Status, EmployeeData.BonusGroup
FROM EmployeeData LEFT JOIN qryBonusEligReport ON
EmployeeData.EmployeeName =
qryBonusEligReport.EmployeeName;
I have two main tables:
tblEvents tblEmployeeData
FileNumber FileNumber
Event EmployeeName
EventDate Department
EventID HireDate
Status
EmployeeID
I have the query working exactly the way I want it to, and
I have the report already set up. I use a print dialog
form to print the report, and I enter the date range I
want to print on the print dialog form.
Here's a portion of the code:
If (ReptToPrint = 6) Then
DoCmd.OpenReport "rptBonusEligibilityDetail",
acPreview, "", ("([Date]Between Forms![frmPrintReports]!
[txtBegDate] and Forms![frmPrintReports]![txtEndDate]) or
([Date] is Null) ")
End If
The problem arises when I specify the date range. I
included the is Null portion of the where clause so that I
would still be able to get all the employees' names on the
report, whether they've had an absence, tardy, etc. or
not. However, the way I have the clause worded, I get all
the employees with an Event within the date range
specified and those employees with NO Events at all. What
I want is to display ALL the employees, regardless of
whether they have any Events, but if they do have Events I
need to show ONLY the events for the date range I
specified.
I hope I've been able to make myself clearer.
Thanks so much (again)!