Dcount Help

sysop470

Registered User.
Local time
Today, 05:37
Joined
Mar 25, 2005
Messages
87
Hi.

I have a table which conatains DATE of Entry and Tick Box. I need to DCOUNT those tick boxes which are yes for the month of January from the field date of entry.

Can someone help me please.
Thanks a lot
 
Try something like:
Code:
   Dim MyCount As Long
   MyCount = DCount("*", "[YourTableName]", _
         "([Tick Box] = True) AND " & _
         "(Year([DATE of Entry]) = Year(Date())) AND " & _
         "(Month([DATE of Entry]) = 1)")
...using your table and field names of course.
 
Try something like:
Code:
   Dim MyCount As Long
   MyCount = DCount("*", "[YourTableName]", _
         "([Tick Box] = True) AND " & _
         "(Year([DATE of Entry]) = Year(Date())) AND " & _
         "(Month([DATE of Entry]) = 1)")
...using your table and field names of course.

You are great.. It works perfectly.
Thanks a lot my friend
Keep it up!!!!!!!!!
 
Glad I could help.

Thanks. With your help i manage to do it. But now i want to be filtered by COUNTER, becuase i want to dcount for specific user. I have add the COUNTER but its not working. Any help pls?


Dim MyCount As Long
MyCount = DCount("*", "[YourTableName]", _
"([Tick Box] = True) AND " & _
"(Year([DATE of Entry]) = Year(Date())) AND " & _
"(Month([DATE of Entry]) = 1) and " & _
" [Counter] = Forms![Personal Information]![Counter] ")
 
Try:
Code:
   Dim MyCount As Long
   MyCount = DCount("*", "[YourTableName]", _
         "([Tick Box] = True) AND " & _
         "(Year([DATE of Entry]) = Year(Date())) AND " & _
         "(Month([DATE of Entry]) = 1 AND " & _
         "([Counter] = " & Me.Counter & ")")
 
Try:
Code:
   Dim MyCount As Long
   MyCount = DCount("*", "[YourTableName]", _
         "([Tick Box] = True) AND " & _
         "(Year([DATE of Entry]) = Year(Date())) AND " & _
         "(Month([DATE of Entry]) = 1 AND " & _
         "([Counter] = " & Me.Counter & ")")

Thanks a lot my friend..
 

Users who are viewing this thread

Back
Top Bottom