DCount syntax

B

brad

i have an calculated field in a query:

Total Claims Denied: DCount('nbr965ID','tblPPTable',' strDailyDecision =
"Deny" ')

I am trying to get this to total for all dates (dtmPPReportDate) and aren't
having much luck. Please advise the syntax for this. Thanks.
 
D

Dennis

Use double quotes around your field name and table and single quotes around a
string criteria the 'where' part of the DCount statement

DCount("nbr965ID","tblPPTable","strDailyDecision = 'Deny'")
 
B

brad

thank you...that may be a big part of my problem. another ? i have is tryin
to find out the syntax for getting it to count for each line in the totals
query...the examples i have " ' [fieldname] = & ' " [fieldname], etc. don't
seem to work. any suggestions? thanks again for you time and help.
 
D

Dennis

The syntax for a numeric comparison is
=DCount("[A Field]","[A Domain]","[FieldName] = " & [FieldName])
The syntax for a textual comparison is
=DCount("[A Field]","[A Domain]","[FieldName] = '" & [FieldName] & "'")

brad said:
thank you...that may be a big part of my problem. another ? i have is tryin
to find out the syntax for getting it to count for each line in the totals
query...the examples i have " ' [fieldname] = & ' " [fieldname], etc. don't
seem to work. any suggestions? thanks again for you time and help.


Dennis said:
Use double quotes around your field name and table and single quotes around a
string criteria the 'where' part of the DCount statement

DCount("nbr965ID","tblPPTable","strDailyDecision = 'Deny'")
 
Top