PDA

View Full Version : Solved: Count Unique



satyen
02-24-2010, 02:12 PM
Hello.

I have a set of numbers i.e.

5555
4444
4444
23411
2345234
55555
4444

Is there a function in Ms Access that I can use within a query- not code so that it calculates 5 as the answer using the dummy data above for example.

I know you'd need to Sort firstly. There is a formula in Excel which I have used and it works, but need the equivalent for MS Access, if anyone knows?

Many Thanks in advance.

domfootwear
02-24-2010, 05:55 PM
Hello.

I have a set of numbers i.e.

5555
4444
4444
23411
2345234
55555
4444

Is there a function in Ms Access that I can use within a query- not code so that it calculates 5 as the answer using the dummy data above for example.

I know you'd need to Sort firstly. There is a formula in Excel which I have used and it works, but need the equivalent for MS Access, if anyone knows?

Many Thanks in advance.

You can create 2 Queries to do this.

Query1: (Source Table1)


SELECT Table1.[No]
FROM Table1
GROUP BY Table1.[No];


Query2: (Source Query1)


SELECT Count(Query1.[No]) AS CountOfNo
FROM Query1;

satyen
02-24-2010, 11:49 PM
thanks I shall give it a go and let you know how I get on!

efz
03-03-2010, 02:46 PM
thanks