C
CEV
I have the following query setup to count how many of each goal.
SELECT tblGoals.Goal, Count(*) AS TotalCount,
Count(IIf(tblGoals.Goal="Relationship",0)) AS RelationshipGoalCount,
Count(IIf(tblGoals.Goal="Travel",1)) AS TravelGoalCount,
Count(IIf(tblGoals.Goal="Residence",2)) AS ResidenceGoalCount,
Count(IIf(tblGoals.Goal="Employment",3)) AS EmploymentGoalCount,
Count(IIf(tblGoals.Goal="Living Skills",4)) AS LivingSkillsGoalCount,
Count(IIf(tblGoals.Goal="Education",5)) AS EducationGoalCount,
Count(IIf(tblGoals.Goal="Communication",6)) AS CommunicationGoalCount,
Count(IIf(tblGoals.Goal="Health",7)) AS HealthGoalCount,
Count(IIf(tblGoals.Goal="Recreation",8)) AS RecreationGoalCount,
Count(IIf(tblGoals.Goal="Financial",9)) AS FinancialGoalCount FROM tblGoals
WHERE (((tblGoals.DateofPlan) Between Forms!frmOutcomesReports!cboBeginDate
And DateAdd("s",86399,Forms!frmOutcomesReports!cboEndDate))
And ((tblGoals.Goal)="Relationship" Or
(tblGoals.Goal)="Travel" Or
(tblGoals.Goal)="Residence" Or
(tblGoals.Goal)="Employment" Or
(tblGoals.Goal)="Living Skills" Or
(tblGoals.Goal)="Education" Or
(tblGoals.Goal)="Communication" Or
(tblGoals.Goal)="Health" Or
(tblGoals.Goal)="Recreation" Or
(tblGoals.Goal)="Financial"))
GROUP BY tblGoals.Goal;
This query is currently working, but I would like to add additional items to
count. Each Goal has a GoalProgress field with 8 different possible answers.
Now that I have the total number of each Goal, for example 40 Travel, I
would like to know how many of those 40 have a GoalProgress of "Yes","No",
"In Progress", etc, etc. and the percentage of each. If someone could please
show me what the first couple of lines should look like, I can enter the
criteria for all the options.
Thank You,
CEV
SELECT tblGoals.Goal, Count(*) AS TotalCount,
Count(IIf(tblGoals.Goal="Relationship",0)) AS RelationshipGoalCount,
Count(IIf(tblGoals.Goal="Travel",1)) AS TravelGoalCount,
Count(IIf(tblGoals.Goal="Residence",2)) AS ResidenceGoalCount,
Count(IIf(tblGoals.Goal="Employment",3)) AS EmploymentGoalCount,
Count(IIf(tblGoals.Goal="Living Skills",4)) AS LivingSkillsGoalCount,
Count(IIf(tblGoals.Goal="Education",5)) AS EducationGoalCount,
Count(IIf(tblGoals.Goal="Communication",6)) AS CommunicationGoalCount,
Count(IIf(tblGoals.Goal="Health",7)) AS HealthGoalCount,
Count(IIf(tblGoals.Goal="Recreation",8)) AS RecreationGoalCount,
Count(IIf(tblGoals.Goal="Financial",9)) AS FinancialGoalCount FROM tblGoals
WHERE (((tblGoals.DateofPlan) Between Forms!frmOutcomesReports!cboBeginDate
And DateAdd("s",86399,Forms!frmOutcomesReports!cboEndDate))
And ((tblGoals.Goal)="Relationship" Or
(tblGoals.Goal)="Travel" Or
(tblGoals.Goal)="Residence" Or
(tblGoals.Goal)="Employment" Or
(tblGoals.Goal)="Living Skills" Or
(tblGoals.Goal)="Education" Or
(tblGoals.Goal)="Communication" Or
(tblGoals.Goal)="Health" Or
(tblGoals.Goal)="Recreation" Or
(tblGoals.Goal)="Financial"))
GROUP BY tblGoals.Goal;
This query is currently working, but I would like to add additional items to
count. Each Goal has a GoalProgress field with 8 different possible answers.
Now that I have the total number of each Goal, for example 40 Travel, I
would like to know how many of those 40 have a GoalProgress of "Yes","No",
"In Progress", etc, etc. and the percentage of each. If someone could please
show me what the first couple of lines should look like, I can enter the
criteria for all the options.
Thank You,
CEV