T
ThomasK via AccessMonster.com
I'm tring to build a query that will count the number of checkboxes between
the dates of two other fields. I have two tables within the query. One table
(tblInspection) contains InspectionID, InspectionDate, and Citation, among
others. The other table (tblReinspection) contains ReinspectionID, and
ReinspectionDate, among others. There is a one to many relationship between
the two tables, tblInspection being the parent table. Only one InspectionDate
will be entered but none or many ReinspectionDates may be entered. The
Citation field is a checkbox.
What I am tring to do is to find all the records that have date entries
between two dates (inspection or reinspection dates) and then count all of
the records with checkmarks in the citation field. The problem is that
several records for the same inspection because there may be several
reinspection dates. When I try to count the checkmarks it counts one for each
record. I need it to count one for each inspection.
This is where I started.
SELECT tblInspections.InspectionDate, tblReinspections.ReinspectionDate,
tblInspections.Citation
FROM tblInspections INNER JOIN tblReinspections ON tblInspections.
InspectionID = tblReinspections.InspectionID;
Thanks for the help.
the dates of two other fields. I have two tables within the query. One table
(tblInspection) contains InspectionID, InspectionDate, and Citation, among
others. The other table (tblReinspection) contains ReinspectionID, and
ReinspectionDate, among others. There is a one to many relationship between
the two tables, tblInspection being the parent table. Only one InspectionDate
will be entered but none or many ReinspectionDates may be entered. The
Citation field is a checkbox.
What I am tring to do is to find all the records that have date entries
between two dates (inspection or reinspection dates) and then count all of
the records with checkmarks in the citation field. The problem is that
several records for the same inspection because there may be several
reinspection dates. When I try to count the checkmarks it counts one for each
record. I need it to count one for each inspection.
This is where I started.
SELECT tblInspections.InspectionDate, tblReinspections.ReinspectionDate,
tblInspections.Citation
FROM tblInspections INNER JOIN tblReinspections ON tblInspections.
InspectionID = tblReinspections.InspectionID;
Thanks for the help.