Multiple column query

  • Thread starter jerry001 via AccessMonster.com
  • Start date
J

jerry001 via AccessMonster.com

Hi.

I have a table with 15 columns (name, surname etc.)
There are blank some fields.

Is there a way to design a SINGLE query that counts blank fields and groups
them by column?

For instance, the report results should look like:

10 records with blank name
12 records with blank surname

etc.

I know how to do this with multiple sql queries (one for each column).
The question is, can it be done with a single query/function?)
 
A

Allen Browne

1. In query design view, depress the total button on the toolbar. Access
adds a Total row to the design grid.

2. Type this expression into a fresh column in the Field row:
BlankSurname: ([surname] Is Null)
Choose Sum in the Total row under this field.

3. Repeat step 2 for the other fields you want to know about.

Don't put any other fields in the query. It will return one row, with the
negative count of the number of fields (e.g. -15 if there are 15 rows that
have the surname blank.)
 
J

jerry001 via AccessMonster.com

Exactly what i was looking for

you're the best!



Regards!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top