Posted - 07/24/2013 : 23:26:37
| Hi everyone. I have a table in Access 2007 that has about 30 field names and I want to have a count of how many unique rows there are in each field. I want to have these results put into another table that will just have the field name and then the count of how many unique rows there are.
I have code in VBA that will loop through my SQL and change out the field name, but I can't seem to get the SQL right before I can start looping it. For just one field name this would be what I have to count the unique names...
So far I have this:
INSERT INTO newtable
COUNT(*) FROM (SELECT Raw_Table.FieldName, COUNT(Raw_Table.FieldName) AS CountOfFieldName
GROUP BY Raw_Table.FieldName);
And its not going too well.
If any of you SQL gurus could fix this problem for a novice like myself, it would really be a big help. Thanks in advance.