Link to home
Start Free TrialLog in
Avatar of Pdeters
Pdeters

asked on

Access 2033 counting number of records in a form that the field is not null

I have an Access form that I am counting the number of records in a form. If the field is null I do not want to count it but still show the record for all the other fields.

This is what I am useing
Count([task1])

This field could be null but the other fields need to be showing. How do I count haev it count jsut the records where this field is not null
Avatar of Graham Mandeno
Graham Mandeno
Flag of New Zealand image

What you have should work.

=Count(*) should give a count of all records

=Count([task1]) should give a count of records where [task1] is not null

Are you sure that you don't have records where [task1] is a zero-length string which looks like Null but is not?

Best regards,
Graham
Also try ....

DCount("[task1]", "YourTable/Query", "Nz([task1], '')<>''")


ET


This will give you all the fields plus the count of all non-null values of fld3:

SELECT a.fld1, a.fld3, a.fld3, (SELECT Count(b.fld3) FROM myTable b) AS CountFld3 FROM myTable a
ASKER CERTIFIED SOLUTION
Avatar of GRayL
GRayL
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks, glad to help.