• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 549
  • Last Modified:

Using DCOUNT in Access with multiple criteria


I have a database that tracks pupil progress with different subjects which are rated at different levels . I have a Y/N filed which indicates if the subject has been passed.  I have this written in the footer of the form

=DCount("PupilID","S2 List","PupilID=" & [PupilID] & " AND Pass= TRUE" AND " LCode=3 ")

If I run it with

=DCount("PupilID","S2 List","PupilID=" & [PupilID] & " AND Pass= TRUE" )

It tells me how many subjects have been passed but if I add the bit that asks  for those subjects with level (LCode) 3 that have been passed it just counts all the records my guess is i have some quotes in wrong place but cannot work it out ...

Any help appreciated.
1 Solution
Try this:

=DCount("PupilID","S2 List","PupilID=" & [PupilID] & " AND Pass= TRUE AND  LCode=3 ")
tmckeatingAuthor Commented:
Thanks you saved me hours of torture with spaces quotes and brackets...works perfectly! Much appreciated.

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now