Hi!
I had posted a question about the DCount function a few days ago and CosmoKramer was able to help me out a bit but my expression is still not complete and I am running out of ideas as to how to solve this problem.
I have created a report for viewing information on the People Affected but before viewing this report, from a form, you must select who is affected from the option group .... "1" = Employee, "2" = Patient, "3" = Visitor / Volunteer, the value goes into the [PersonAffected] field. and then you select the beginning date and the ending date.
Now, on my report I have a summary box with the following information:
2002 Summary:
Quarter: #Incidents #EmplInci #PtInci #V/VInci
1 1 0 0 1
2 1 0 1 0
3 15 4 8 3
4 1 0 1 0
----- ----- ----- -----
Totals: 18 4 10 4
but this is not the data that I am getting because the DCount expression that have is not functional or complete at this time.
Here is an example of it:
=DCount("[PersonAffected]","IncidentsByPersonQuery","[PersonAffected]='2' AND DatePart('q',[DateIncident])=1 AND DatePart('yyyy',[DateIncident])=[Year]"
so what I want to do is count how many Patients have been affected, then how many employees and then how many visitor/volunteers have been affected. When I count them, I want the sums to be displayed into the right quarters and per year. The way that my DCount is working now is that it's counting the incidents for all of the patients but for all of the years. So I need something else in my criteria to count only the Patients affected for that year only (lets say 2001) then on the next year only patients for that year (2002) and so on......
I had posted a question about the DCount function a few days ago and CosmoKramer was able to help me out a bit but my expression is still not complete and I am running out of ideas as to how to solve this problem.
I have created a report for viewing information on the People Affected but before viewing this report, from a form, you must select who is affected from the option group .... "1" = Employee, "2" = Patient, "3" = Visitor / Volunteer, the value goes into the [PersonAffected] field. and then you select the beginning date and the ending date.
Now, on my report I have a summary box with the following information:
2002 Summary:
Quarter: #Incidents #EmplInci #PtInci #V/VInci
1 1 0 0 1
2 1 0 1 0
3 15 4 8 3
4 1 0 1 0
----- ----- ----- -----
Totals: 18 4 10 4
but this is not the data that I am getting because the DCount expression that have is not functional or complete at this time.
Here is an example of it:
=DCount("[PersonAffected]","IncidentsByPersonQuery","[PersonAffected]='2' AND DatePart('q',[DateIncident])=1 AND DatePart('yyyy',[DateIncident])=[Year]"
so what I want to do is count how many Patients have been affected, then how many employees and then how many visitor/volunteers have been affected. When I count them, I want the sums to be displayed into the right quarters and per year. The way that my DCount is working now is that it's counting the incidents for all of the patients but for all of the years. So I need something else in my criteria to count only the Patients affected for that year only (lets say 2001) then on the next year only patients for that year (2002) and so on......