Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DCount Help 2

Status
Not open for further replies.

Herdrich

Technical User
Dec 30, 2008
83
US
Ok im trying to DCount using two different variables. I can use =DCount("Type", "All Query") and that works for all types fine but am trying to use something like =DCount("Type" = "Escorted" And "DateOut" = Date(), "All Query") So that i can specify the type of escorted and records that also match the current date. Any suggestions?
 
Take a look at the help file it provides a good example.
 
So far with that this works

=DCount("*","All Query","[Type] = 'Escorted'")

But this does not

= DCount("*", "All Query", "[TimeOut] = Now")
or
= DCount("*", "All Query", "[TimeOut] = Date()")

It only reads out 0 is this because im using the Now date and that includes time so its not matching?
 
you would need to have your functions outside your "". If not you just get the literal string. Something like

"TimeOut = " & Int(date())

If you take the int of date you get the value of the day without time.
 
Still not working for me :(. In my table im using the Now date format to set the date so I have date and time. I have even tried changing a few of them to the normal 10/11/2010 and ran the DCount as = DCount("*", "All Query", "TimeOut = " & Int(date())) With no luck. Is that correct or is there something different i should be using?
 
Thanks Duane, sometimes I get backwards things around, I mean things around backwards.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top