Hi
I've built an access database and I've been asked to build the query below, but I'm not sure how to, as my access and SQL skills are limited.
I have the following list of items and I need to list all the non duplicates from column 1 (REF), then count the duplicates from column 1 (REF) and count the non duplicates from column 3 (CODE) for each REF e.g
REF NAME CODE
CR9999 happy birthday WLBIR
CR9999 happy Christmas WLEAC
CR9999 happy anniversary WLANN
CR9999 happy Easter WLEAC
CR8764 Thank you WLTHN
CR8764 With Compliments WLTWC
CR4545 Get well soon WLGWS
CR4545 Get well soon Mum WLGWS
CR4545 Get well soon Nan WLGWS
Result:-
CR9999 4 3
CR8764 2 2
CR4545 3 1
This would tell me that for CR9999 there are 4 entries with that reference and there are 3 different sets of code that cover those 4 entries.
Any help would be gratefully appreciated.
Thanks
I've built an access database and I've been asked to build the query below, but I'm not sure how to, as my access and SQL skills are limited.
I have the following list of items and I need to list all the non duplicates from column 1 (REF), then count the duplicates from column 1 (REF) and count the non duplicates from column 3 (CODE) for each REF e.g
REF NAME CODE
CR9999 happy birthday WLBIR
CR9999 happy Christmas WLEAC
CR9999 happy anniversary WLANN
CR9999 happy Easter WLEAC
CR8764 Thank you WLTHN
CR8764 With Compliments WLTWC
CR4545 Get well soon WLGWS
CR4545 Get well soon Mum WLGWS
CR4545 Get well soon Nan WLGWS
Result:-
CR9999 4 3
CR8764 2 2
CR4545 3 1
This would tell me that for CR9999 there are 4 entries with that reference and there are 3 different sets of code that cover those 4 entries.
Any help would be gratefully appreciated.
Thanks