Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Count Questions in Access 2010 Table

Posted on 2015-02-09
1
Medium Priority
?
125 Views
Last Modified: 2015-02-09
I have an access table that I need to count the non-null values in each row. In the attached spreadsheet notice the count in the Total_Questions Column. I'm trying to figure out how to calculate either in a query or using VBA, Thanks
Count.xlsx
0
Comment
Question by:shieldsco
1 Comment
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 total points
ID: 40599706
you can use a query like this

select
Iif([q1] & ""<>"",1,0)  +
Iif([q2] & ""<>"",1,0)  +
Iif([q3] & ""<>"",1,0)  +
Iif([q4] & ""<>"",1,0)  +
Iif([q5] & ""<>"",1,0)  +
Iif([q6] & ""<>"",1,0)  +
Iif([q7] & ""<>"",1,0)  As Total_questions
From TableName
0

Featured Post

Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

824 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question