[AccessD] unique patients

Charlotte Foust charlotte.foust at gmail.com
Thu Nov 3 16:07:43 CDT 2011


Only if UniquePatient is the field you're extracting.  Just counting the
records returned gives you the number of unique patients, and the unique
combinations of Uitv and Sub are there in each record.

Charlotte Foust

On Thu, Nov 3, 2011 at 1:53 PM, Stuart McLachlan <stuart at lexacorp.com.pg>wrote:

> That won't work, it will return 3   for A - ee.
>
> Gustav's solution is the way I would do it - use a select Distinct Query
> first to get rid of the
> duplicates.
>
> On 3 Nov 2011 at 9:49, David McAfee wrote:
>
> > SELECT Uitv, Sub, COUNT(Patient) AS UniquePatient
> > FROM tblSomeTable
> > GROUP BY Uitv, Sub
> > ORDER BY Uitv, Sub
> >
> >
> > On Thu, Nov 3, 2011 at 2:43 AM, <pedro at plex.nl> wrote:
> >
> > > Dear Group,
> > >
> > > how can i query the unique patients, from "Uitv" and "Sub".
> > >
> > > Data
> > >
> > > Uitv    Sub     Patient
> > > A       ee      101
> > > A       ee      101
> > > A       ee      102
> > > A       ff      201
> > > A       gg      301
> > > B       ee      201
> > > B       ee      301
> > > B       hh      501
> > >
> > >
> > >
> > > Result
> > >
> > > Uitv    Sub     Unique Patient
> > > A       ee        2
> > > A       ff        1
> > > A       gg        1
> > > B       ee        2
> > > B       hh        1
> > >
> > >
> > > Thanks
> > >
> > > Pedro Janssen
> > >
>



More information about the AccessD mailing list