Originally Posted by
June7
Aggregate functions aggregate records not fields. You have to "roll your own". Cannot compare anything to NULL, not even another NULL, because there is nothing to compare.
If you want a count for each record, expression in query:
IIf(d1age IS NULL, 0, 1) + IIf(d2age IS NULL, 0, 1) + IIf(d3age IS NULL, 0, 1)
in textbox:
=IIf(IsNull(d1age), 0, 1) + IIf(IsNull(d2age), 0, 1) + IIf(IsNull(d3age), 0, 1)
If you just want a grand total with a query.
SELECT Nz(Sum(d1age),0) + Nz(Sum(d2age),0) + Nz(Sum(d3age),0) AS Cnt FROM table;
Otherwise, normalize data structure. Some day you will encounter a family with more than 10 members.