Problem with DISTINC Count() under Access

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello all,

I have found that it is not possible to:
Select Distinct Count() From xyz Where foo=bar;

How can I workaround this?
I need to do this several times for different data.

Thank you in advance.

Ciao,
Mel
 
You need to use a SubQuery to select distinct values first before you can
count the distinct values.
 
Van said:
You need to use a SubQuery to select distinct values first before you can
count the distinct values.

I think you mean a 'derived table' e.g.

SELECT COUNT(*) FROM (Select Distinct * From xyz Where foo=bar) AS DT1
 
Same difference, isn't it?

I referred to the construct. You referred to the usage. Hernandez &
Viescas book "SQL Queries for Mere Mortals" refers to "Table SubQuery".
 
Van said:
Same difference, isn't it?

I referred to the construct. You referred to the usage. Hernandez &
Viescas book "SQL Queries for Mere Mortals" refers to "Table SubQuery".

Thanks for clarifying (though the PascalCase name makes me cringe a
little <g>).
 
Back
Top