Access Dcount (multiple criteria)

Joined
Jul 8, 2021
Messages
2
Reaction score
0
I have setup a link table called "Schedule" which includes the following attributes: RecordID, Start , Proposed, Confirmed, Cancelled, Completed.

I need to write a DCOUNT query to count the number of records with the following criteria:
DCount "*" records in table "Schedule" with
"Start >= #date1# and < #date2#"
AND
"Proposed = 'Yes'"

(The same scenario above goes for other attributes i.e.(Confirmed, Cancelled and Completed) in separate columns in the same query.

I tried the below, but it seems to ignore the criteria and results in count of all records in that table:

Field: =DCount("*","[Schedule]","proposed = 'Yes'" And "[start]>=#1/07/2021#And<#1/08/2021#")
Table:
Total: Group By
Sort:
Show: "Checked"
Criteria:
Or:

A bit rusty with the syntax, needed to know if it is possible to specify multiple criteria in the criteria field of a DCOUNT function and if so can you please provide the right syntax?

Your help is much appreciated.
 
Joined
Apr 12, 2022
Messages
9
Reaction score
3
Field: =DCount("*","[Schedule]","proposed = 'Yes'" And "[start]>=#1/07/2021#And<#1/08/2021#")

Assuming Proposed is a Yes/No field, try

Code:
DCount("[Proposed]", "Schedule", "[Proposed] = True And [Start] Between #1/07/2021# And #1/08/2021#")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top