J
jkearns
Hi,
I'm having trouble getting a COUNT() on many fields in a table. I have
a table that records the number of times a Student was absent or late
on a given day (attendance is taken 3 times every day). My fields look
like:
StudentID (PK) - Number
TodaysDate (PK) - Date
AssemblyLate - Yes/No
AssemblyAbsent - Yes/No
MorningLate - Yes/No
MorningAbsent - Yes/No
AfternoonLate - Yes/No
AfternoonAbsent - Yes/No
What I want to do, is get the number of times a Student was late or
absent over a given time period. I have qryMultiDay that grabs all of
these fields but then limits TodaysDate to between X and Y (info
provided from a form). I then have 6 more queries (one for each
late/absent) that query qryMultiDay to find the count of each field.
For example, the AfternoonLate query looks like:
SELECT qryMultiDay.CurrentID, Count(qryMultiDay.AfternoonLate) AS
CountOfAfternoonLate
FROM qryMultiDay
GROUP BY qryMultiDay.CurrentID, qryMultiDay.AfternoonLate
HAVING (((qryMultiDay.AfternoonLate)=True));
I am then trying to join all of these 6 quries together to make a
report that might look like:
Student Assembly L A Morning L A Afternoon L A
Student01 0 4 0 4 1 4
Student02 2 1 0 1 2 2
etc.
Problem: when I join all of the queries, I get no results. Any
suggestions on what might be wrong (I think it has something to do with
the fact that all students do not appear in all records), or a better
way to do this?
Thanks in advance!
JK
I'm having trouble getting a COUNT() on many fields in a table. I have
a table that records the number of times a Student was absent or late
on a given day (attendance is taken 3 times every day). My fields look
like:
StudentID (PK) - Number
TodaysDate (PK) - Date
AssemblyLate - Yes/No
AssemblyAbsent - Yes/No
MorningLate - Yes/No
MorningAbsent - Yes/No
AfternoonLate - Yes/No
AfternoonAbsent - Yes/No
What I want to do, is get the number of times a Student was late or
absent over a given time period. I have qryMultiDay that grabs all of
these fields but then limits TodaysDate to between X and Y (info
provided from a form). I then have 6 more queries (one for each
late/absent) that query qryMultiDay to find the count of each field.
For example, the AfternoonLate query looks like:
SELECT qryMultiDay.CurrentID, Count(qryMultiDay.AfternoonLate) AS
CountOfAfternoonLate
FROM qryMultiDay
GROUP BY qryMultiDay.CurrentID, qryMultiDay.AfternoonLate
HAVING (((qryMultiDay.AfternoonLate)=True));
I am then trying to join all of these 6 quries together to make a
report that might look like:
Student Assembly L A Morning L A Afternoon L A
Student01 0 4 0 4 1 4
Student02 2 1 0 1 2 2
etc.
Problem: when I join all of the queries, I get no results. Any
suggestions on what might be wrong (I think it has something to do with
the fact that all students do not appear in all records), or a better
way to do this?
Thanks in advance!
JK