I've tried everything, I just can't seem to get Access to count distinct values in a column, and then grouping those by another column. I need to count distinct values in column1 and group them by column2.
Basically this is the starting data...
col1 col2
1 xx
2 xx
1 yy
2 yy
3 yy
1 zz
1 dd
2 dd
This is the result I need...
col1 col2
2 xx
3 yy
1 zz
2 dd
I tried doing SELECT DISTINCT COUNT(col1) FROM table GROUP BY col2, but Google apparently says Count Distinct is invalid in Access. :(
Question
Zenicanin
I've tried everything, I just can't seem to get Access to count distinct values in a column, and then grouping those by another column. I need to count distinct values in column1 and group them by column2.
Basically this is the starting data...
This is the result I need...
I tried doing SELECT DISTINCT COUNT(col1) FROM table GROUP BY col2, but Google apparently says Count Distinct is invalid in Access. :(
Any suggestions? Thanks :)
Link to comment
Share on other sites
9 answers to this question
Recommended Posts