Discussion Locked

Selective Count in MS Access

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I've created a report that needs to count dates belonging to a particular month from a range of dates. How do I do this in Access since the countif() and dcount() functions don't seem to work in reports?

2 replies

by just_chilin

e.g. to count the orders for july, try this:

SELECT COUNT(*) FROM Orders WHERE Month(OrderDate) = 7

by computerstreber

Access does have a count if statement, but its syntax is different then that of Excel. To use the count if statement in access, you must use this syntax:

=count(iif([date_field]="june",0))

This discussion is closed to new replies.