DLookUp and DCount Problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am having a problem with DLookUp and DCount. First I don't know which one to use where. I need to count records in a table based on a particular date range. I have the report pulling info from a query and I can't include the data from the other table. The data becomes distored some how and it pulls the wrong number
Here is what I tried to do

=DCount("[acct_num]","tbl_Reporting","Month([trans_date] = '10'"

I have an expression built into my query that the report pulls other data from that prompts the user for the number of the month. That is where the '10' is in the equation. The expression is called [Expr1]

Am I way off track with trying to get this data or should I just link the report to the table that has the data in it

Thanks in advance

John
 
Use DCount:

=DCount("*","tbl_Reporting","Month([trans_date]) = '10'")

To use a field name instead of 10:


=DCount("*","tbl_Reporting","Month([trans_date]) = '" & [FieldName] & "'")


--
Ken Snell
<MS ACCESS MVP>


John Daily said:
I am having a problem with DLookUp and DCount. First I don't know which
one to use where. I need to count records in a table based on a particular
date range. I have the report pulling info from a query and I can't include
the data from the other table. The data becomes distored some how and it
pulls the wrong number.
Here is what I tried to do:

=DCount("[acct_num]","tbl_Reporting","Month([trans_date] = '10'")

I have an expression built into my query that the report pulls other data
from that prompts the user for the number of the month. That is where the
'10' is in the equation. The expression is called [Expr1].
Am I way off track with trying to get this data or should I just link the
report to the table that has the data in it?
 
Back
Top