SQL or Query to identify unused fields in a table?

  • Thread starter Thread starter Chrisso
  • Start date Start date
C

Chrisso

Hi there,

I have just been given a poorly designed database with over 100,000
records in one table. This table has a lot of fields and it seems that
apart from the first seven the rest do not hold too much data.

I would like to create a query that tells me how many records actually
have data in each field. I am having troouble doing this.

My pseudo-code is:
for each field in the table
count the number of Null fields
report

Any ideas wil be gratefully accepted.

Chrisso
 
Chrisso said:
Hi there,

I have just been given a poorly designed database with over 100,000
records in one table. This table has a lot of fields and it seems that
apart from the first seven the rest do not hold too much data.

I would like to create a query that tells me how many records actually
have data in each field. I am having troouble doing this.

My pseudo-code is:
for each field in the table
count the number of Null fields
report

Any ideas wil be gratefully accepted.

Chrisso

No code needed. In a new Totals query...

DataCount1: Sum(Abs(IsNull(Field1)))
DataCount2: Sum(Abs(IsNull(Field2)))
etc..
 

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

Back
Top