[AccessD] Sub Query Assistance Requested

Kaup, Chester Chester_Kaup at kindermorgan.com
Tue Nov 29 16:14:35 CST 2011


Thanks. Perfect. That got it.

-----Original Message-----
From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jack drawbridge
Sent: Tuesday, November 29, 2011 1:53 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Sub Query Assistance Requested

Chester,
Try

SELECT Count(A.PID) AS [Active Flowing Count],EngArea
FROM
(SELECT DISTINCT A.PID, EngArea
FROM [tbl Statuses During Prior Month] AS A
WHERE(A.Status In ("FL","FM","FH")))
Group by EngArea;

On Tue, Nov 29, 2011 at 9:41 AM, Kaup, Chester <
Chester_Kaup at kindermorgan.com> wrote:

> I have the following query that works correctly returning a result of 8
>
> SELECT Count(A.PID) AS [Active Flowing Count]
> FROM (SELECT DISTINCT A.PID
> FROM [tbl Statuses During Prior Month] AS A
> WHERE(A.Status In ("FL","FM","FH")));
>
> I would also like to return the field EngArea from the table
> [tbl Statuses During Prior Month] also. Would that be possible and if so
> how? My attempts so far have failed.
>
> Result should be something like this
> Active Flowing Count    EngArea
> 3                               1
> 1                               2
> 4                               3
>
> Thanks.
>
> Chester Kaup
> Engineering Technician
> Kinder Morgan CO2 Company, LLP
> Office (432) 688-3797
> FAX (432) 688-3799
>
>
> No trees were killed in the sending of this message. However a large
> number of electrons were terribly inconvenienced.
>
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com





More information about the AccessD mailing list