How to use SUM or COUNT for Text fields?

RIM-Pro

Registered User.
Local time
Today, 16:22
Joined
Aug 11, 2000
Messages
22
I'd have a field in a database that will only have YES or NO values in it (it is not a checkbox). I'd like include a total count of the YES values in a report I've developed. I've tried both the COUNT and SUM operfators (?) but to no avail, I guess they only work with numeric fields.

What else can I do?
 
Haven't tried this but it should work add text box set vis prop to no, set control source to =If([ContName]="Yes",1,0)set sum to new textbox name
 
You need to use the DCOUNT (Domain Count) function not the COUNT function. The COUNT function will always work on all records whereas the DCOUNT allows you to set filtering criteria so that you can restrict the number of records counted based on your criteria.
DCOUNT can be a little awkward to get used to but is very usefull inmany cases. Check out the help file for DCOUNT and make sure you read the part on handling NULL records as this can often cause unexpected results if you are not aware of how it works.
Hope this helps
Trevor from Accesswatch.co.uk
 

Users who are viewing this thread

Back
Top Bottom