[thelist] counting used columns in Access SQL

Ed McCarroll Ed at ComSimplicity.com
Wed Oct 15 18:59:02 CDT 2003


SELECT name, (IIf(IsNull(val1),0,1) + IIf(IsNull(val2),0,1) 
 + IIf(IsNull(val3),0,1)) AS steps
 FROM WhateverTable WHERE (OtherConditions = met);

Or you might want to replace IsNull with a function of your own
design that also checks for blank values.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ed McCarroll                          MailTo:Ed at ComSimplicity.com
ComSimplicity                                      (310) 838-4330
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 



More information about the thelist mailing list