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.
 
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#")
 
Back
Top