Hello!
I have many names in column "Name". Now i want count different names in column "Name"
Earlier using 2 queries. first group and second count but is any fastest way and using 1 query?
Hello!
I have many names in column "Name". Now i want count different names in column "Name"
Earlier using 2 queries. first group and second count but is any fastest way and using 1 query?
Really you need COUNT(DISTINCT Name) but I don't think Access will let you do this. A nested query usually works, though the access sql editor sometimes does funny things with these queries after you save them.
SELECT COUNT(*) FROM
(
SELECT DISTINCT [fieldname] FROM [tablename]
)
You could also save the subquery as a query in its own right, so you could have
qryDistinctNames = 'SELECT DISTINCT [Name] FROM TableName'
and
qryDistinctNameCount = 'SELECT COUNT(*) FROM qryDistinctNames'
However, there's probably a nicer way of doing this, which I'm sure someone will tell us!