I am trying to determine if a DCount function would be more efficient than a query to return the count the items in a table.
I got the SQL to work but I am struggling with the correct syntax for the DCount statement because of the joined table. I am able to get this simple function to work but it is only looking at an ID rather than the LEFT 6 of the form field
If DCount is more efficient, I could use some help with syntax
Here is the SQL
Here is the DCount function
I got the SQL to work but I am struggling with the correct syntax for the DCount statement because of the joined table. I am able to get this simple function to work but it is only looking at an ID rather than the LEFT 6 of the form field
If DCount is more efficient, I could use some help with syntax
Here is the SQL
Code:
SELECT tbl_SampleGroups.GroupNumber, Count(tbl_Samples.GroupID) AS CountOfGroupID
FROM tbl_Samples INNER JOIN tbl_SampleGroups ON tbl_Samples.GroupID = tbl_SampleGroups.SampleGroupID
GROUP BY tbl_SampleGroups.GroupNumber
HAVING (((tbl_SampleGroups.GroupNumber)=Left([Forms]![frm_Login]![GroupNumber],6)));
Here is the DCount function
Code:
DCount("[sampleid]", "tbl_Samples", "[GroupID] = 7")