You really haven't given enough information.
Are you wishing to count or sum all records in a table?
Or just records shown in a report?
You did say a Text "Yes", not a numeric Yes value, didn't you?
All in the table use Domain Aggregate functions:
=DCount("*","TableName","[FieldName] = 'Yes'")
=DSum("[NumberField]","TableName","[FieldName] = 'Yes'")
Just records shown in the report:
To Count!!!
= Sum(IIf([SomeField] = "Yes",1,0))
To Sum
= Sum(IIf([SomeField] = "Yes",[NumberField],0))
--
Fred
Please reply only to this newsgroup.
I do not reply to personal e-mail.
Maz Ten said:
I am trying to count a certain field on a form/report on the condition it
contains the text "Yes" is there a function in Access like the function in
Excel
CountIf and SumIf
Any help would be appreciated
Maz Ten