I come again to the well of knowledge...
I have an anomaly happening with a query that is functioning properly except for one record.
I have a table with a list of supervisors and a second table with a list of staff. Each staff record contains a supervisor code that refers back to the list of supervisors.
As part of the startup steps in my front end, I update the supervisor's table with a count of how many staff each supervisor has, sine a supervisor's direct reports can change daily. It works fine for all supervisors except one which gets calculated as zero, even though I know that the supervisor has 17 staff reporting to her.
Here's the query I run:
This updates the staff count for each supervisor in the supervisor table (tblPeopleStaffSupervisors) based on the count of records in the staff table (tblStaff) where the staff person's supervisor code matches the supervisor code in the supervisors table.
I have looked for anomalies in the spelling of the supervisor code versus what's in the staff table and they appear to be a perfect match.
It's baffling because it works for 81 other supervisors but not for this one.
I'm looking for clues as to why this is happening.
Thanks,
Ken
I have an anomaly happening with a query that is functioning properly except for one record.
I have a table with a list of supervisors and a second table with a list of staff. Each staff record contains a supervisor code that refers back to the list of supervisors.
As part of the startup steps in my front end, I update the supervisor's table with a count of how many staff each supervisor has, sine a supervisor's direct reports can change daily. It works fine for all supervisors except one which gets calculated as zero, even though I know that the supervisor has 17 staff reporting to her.
Here's the query I run:
Code:
UPDATE tblPeopleStaffSupervisors SET tblPeopleStaffSupervisors.STAFFCOUNT = DCount('SUPERVISORCODE_I','tblStaff','SUPERVISORCODE_I=""' & [tblPeopleStaffSupervisors].[SUPERVISORCODE_I] & '""'
This updates the staff count for each supervisor in the supervisor table (tblPeopleStaffSupervisors) based on the count of records in the staff table (tblStaff) where the staff person's supervisor code matches the supervisor code in the supervisors table.
I have looked for anomalies in the spelling of the supervisor code versus what's in the staff table and they appear to be a perfect match.
It's baffling because it works for 81 other supervisors but not for this one.
I'm looking for clues as to why this is happening.
Thanks,
Ken