Query Question

L

Larry Dietrick

I have two fields in a table. One is a date in the form
1/1/03, and one is a Yes/No field. I want to create a
query that will tell me how many of the entries in one
month (say January) have a corresponding Yes in the second
field. In other words, how many of the entries that begin
with a "1" in the date field are "Yes" in the "Yes/No"
field. Any ideas? Thanks in advance for any help.
 
V

Van T. Dinh

The SQL String should be something like:

SELECT Count(*)
FROM YourTable
WHERE (DateField BETWEEN #01/01/2003# AND #01/31/2003#)
AND (YesNoField = True)

In code you can also use the DCount() function.

Check Access VB on the DCount() function

HTH
Van T. Dinh
MVP (Access)
 

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

Top