Looking for help counting records on a report. Here is how I have my database setup. Note, I am a very novice Access user.
Tables: Fields
1. DPM Name: DPM UID, Name, Location [NOTE: a DPM name may have multiple locations, eg. DPM A located at P1/S2 and P2/S4, so each DPM name and its various locations has its own UID.)
2. Violations: DPM UID, Violation UID, Rule #, Fine Amount
DPM UID is linked to Violations UID. So, when inputting a new violation, it pulls the DPM information from the DPM table.
==============
On a report, I want to display how many times a DPM and its separate locations, if applicable, was in violation.
==============
Violations table has these records:
DPM Name | Location | Rule # | Fine Amt
DPM A | P2/S4 | Rule 5 | $50
DPM A | P2/S4 | Rule 5 | $75
DPM A | P2/S7 | Rule 5 | $25
==============
On the report, I want it to display:
DPM Name | Location | Rule # | Fine Amt | # Times in Violation
DPM A | P2/S4 | Rule 5 | $50 | 2
DPM A | P2/S4 | Rule 5 | $75 | 2
DPM A | P2/S7 | Rule 5 | $25 | 1
If I use the count function and count how many times a DPM Name appears, then I'll get a total of 3 rather than 2 and 1.
**I want it to count as I have shown above.**
Initially, I thought I could create a field in the Violations Table called Viol# and put a number in it each time a DPM and its location(s) has a violation BUT the count needs to be calculated based upon a prior 24 month period.
Any help is greatly appreciated!
Thanks!
Tables: Fields
1. DPM Name: DPM UID, Name, Location [NOTE: a DPM name may have multiple locations, eg. DPM A located at P1/S2 and P2/S4, so each DPM name and its various locations has its own UID.)
2. Violations: DPM UID, Violation UID, Rule #, Fine Amount
DPM UID is linked to Violations UID. So, when inputting a new violation, it pulls the DPM information from the DPM table.
==============
On a report, I want to display how many times a DPM and its separate locations, if applicable, was in violation.
==============
Violations table has these records:
DPM Name | Location | Rule # | Fine Amt
DPM A | P2/S4 | Rule 5 | $50
DPM A | P2/S4 | Rule 5 | $75
DPM A | P2/S7 | Rule 5 | $25
==============
On the report, I want it to display:
DPM Name | Location | Rule # | Fine Amt | # Times in Violation
DPM A | P2/S4 | Rule 5 | $50 | 2
DPM A | P2/S4 | Rule 5 | $75 | 2
DPM A | P2/S7 | Rule 5 | $25 | 1
If I use the count function and count how many times a DPM Name appears, then I'll get a total of 3 rather than 2 and 1.
**I want it to count as I have shown above.**
Initially, I thought I could create a field in the Violations Table called Viol# and put a number in it each time a DPM and its location(s) has a violation BUT the count needs to be calculated based upon a prior 24 month period.
Any help is greatly appreciated!
Thanks!