Dcount() Criteria

S

Sean

I'm trying to do a dcount() and I'm having a problem with the criteria.

I need to count the number of instances of :

[ShipmentID] Is Null WHERE [BoxReadySwitch] = False _
AND [BoxAssignedToVendor] = False _
AND Month([BoxDateCreated]) = Month(Date())

But this doesn't work because of the data types are different and can't be
evaluated as a single value. What I need is to get the INTERSECTION of
records meeting the criteria and count the instances of that subset with the
criteria of [ShipmentID] Is Null.

Any ideas? Thanks
Sean
 
M

Marshall Barton

Sean said:
I'm trying to do a dcount() and I'm having a problem with the criteria.

I need to count the number of instances of :

[ShipmentID] Is Null WHERE [BoxReadySwitch] = False _
AND [BoxAssignedToVendor] = False _
AND Month([BoxDateCreated]) = Month(Date())

But this doesn't work because of the data types are different and can't be
evaluated as a single value. What I need is to get the INTERSECTION of
records meeting the criteria and count the instances of that subset with the
criteria of [ShipmentID] Is Null.

I'm a little confused about what you want, but try something
like this:

x = DCount("*", "thetable", "[ShipmentID] Is Null " _
& " AND [BoxReadySwitch] = False " _
& " AND [BoxAssignedToVendor] = False " _
& " AND Month([BoxDateCreated] = " & Month(Date())
 

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