Dcount() Criteria

  • Thread starter Thread starter Sean
  • Start date Start date
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
 
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())
 
Back
Top