[thelist] counting used columns in Access SQL

Hartwell Bryan bryan.hartwell at theimo.com
Wed Oct 15 16:36:48 CDT 2003


Using the count aggregate is fairly straight forward. However I want to
know, as a number
in a single field, how many columns have a non-null value for that record.

eg.

name  val1 val2 val3
   a       1     2     3
   b       1     2

Results:
name  steps
   a        3
   b        2

The record "a" has 3 columns with values in them, while "b" has only 2. How
would I do
this in MS Access?

Thanx!!
Bryan


*----------------------------------------
This message is intended only for the use of the intended recipients, and it may be privileged and confidential. If you are not the intended recipient, you are hereby notified that any review, retransmission, conversion to hard copy, copying, circulation or other use of this message is strictly prohibited. If you are not the intended recipient, please notify me immediately by return e-mail, and delete this message from your system.
*----------------------------------------



More information about the thelist mailing list