[AccessD] A2000: Am I blind? (swe)

Steve Erbach erbachs at gmail.com
Sun Feb 13 08:25:46 CST 2005


Gustav,

Interesting. I've used subqueries many times as Criteria, but never in
the FROM clause. It works.

My curiosity is aroused by what I found in the MSDN help files. Namely
that T-SQL has a COUNT DISTINCT command. Of course, that doesn't
translate to Access except that one does the kind of thing you
suggested.

Thank you.

Steve Erbach
Neenah, WI


On Sat, 12 Feb 2005 14:23:04 +0100, Gustav Brock <Gustav at cactus.dk> wrote:
> Hi Steve
> 
> You can use a subquery as a subtable:
> 
>   SELECT DISTINCT
>     State
>   FROM
>     Addresses
> 
> Then:
> 
>   SELECT
>     COUNT(*) As StateCount
>   FROM
>       [SELECT DISTINCT
>         State
>       FROM
>         Addresses]. AS
>     T;
> 
> /gustav



More information about the AccessD mailing list