Below is the SQL that I have so far in trying to accomplish a goal. In our database we have Engineers who fill out a form and submit it to others for work to be done. It works pretty good. Each form has some yes/no check boxes that when checked, shows what forklift needs the work. For instance: (CheckBoxes) F187, A910, E010, and C809 indicates a particular Tonnage Forklift that needs to be worked on. I am trying to get a total Forms count that are submitted for a particular date range. The code below works and gives me a total when I have limited the conditions to one CheckBox. When I try to add another CheckBox to the mix my total does not equal the correct total for the date range. Also I need to state here that one or all of the CheckBoxes could be checked on each Form and I would only want to count that Form as 1 no matter how many of the CheckBoxes are checked. I hope this makes sense and someone out there can help me.
Code:
SELECT DCount("[Date_of_Change]","all_trucks_table","[FORM #]=true AND F187=True and [Date_of_Change] Between [Forms]![OmsStatus]![StartDateTxt] And [Forms]![OmsStatus]![EndDateTxt]") AS FORMS
FROM all_trucks_table
GROUP BY
DCount("[Date_of_Change]","all_trucks_table","[FORM #]=true and F187=True AND [Date_of_Change] Between [Forms]![OmsStatus]![StartDateTxt] And [Forms]![OmsStatus]![EndDateTxt]");