Count of contents in field

  • Thread starter Thread starter hermie
  • Start date Start date
H

hermie

In my table I have 20 field which can contains a value from A to F or Blank
In a query I want to count the total of the fields for instance:
Field1 = A
Field2 = B
Field3 = A
Field4 = F
Field5 =
Field6 =
Field7 = D

Total = 5

Help me please to perform this calculation

Herman
 
Hermie,

Count = iif(Field1 is not null,1,0) + iif(Field2 is not
null,1,0) + ...

Better yet, you may wish to re-think the table design,
especially if you do not have to store values for each
question/score/grade or whatever it is.

Mark
 
If you want to count the number of non-null fields in a record then use an
expression like:
=IsNull(Field1) + IsNull(Field2) + IsNull(Field3) + ...IsNull(Field20) + 20

An expression like this generally suggests an un-normalized table structure.
 
I'm not sure what you mean by "reassign my handle in tek-tips". Are you
looking for me to lobby to have you re-instated after getting the boot?
 
Yes if that is possible, i have send several emails to tek-tips for a reason
why I have been banned.
I signed up with a new account and this also is banned, problably tek-tips
banned the IP address in my office?

Herman
 
Tek-Tips has many possible reasons for banning individuals. They will ban
-students looking for others to do their homework projects,
-posters who advertise their services to prominently
-mis-behaving members
-misleading members
-...

I am not aware of why you got bounced. Any member can "red-flag" any message
and the forum owners will generally bounce a member without consulting the
moderators.
 
Back
Top