C
Clay
The data below is a list of inmates(DOCNUM) and the date
that they were sentenced(YrMnthday) and the type of Crime
they commited(CategoryNum). There are several other
fields in my main table (tblAdmissions) such as race,
sex, sentence legnth, etc. that I will need to do
calculations on. The data below are the duplicate
DOCNUM's from this table. For our calcualations, we want
to develop reports that will count the number of inmates
by different breakdowns such as race, sex, etc. for each
month of admission.
My problem, is creating a query that will return a DOCNUM
only one time for each sentence date. In the data below
for example, I want to count DOCNUM 73993 twice, because
he was admitted into prison in both Jan. and May.
However, for DOCNUM 81887, he was only admitted one time
in Dec., but for two different Crime Category's. So, for
him, I want to count the MINIMUM CategoryNum...so in his
case, I would only want the 1st record. For DOCNUM
82081, we would want to count only his CategoryNum "1"
crimes for both dates that he was admitted (Nov 29 and
Mar 12).
DOCNUM Cmnt YrMnthday CategoryNum
73993 A 20010525 2
73993 A 20010117 2
81887 A 20011205 1
81887 A 20011205 2
82081 A 20011129 3
82081 A 20010312 1
82081 A 20011129 1
82081 A 20010312 3
I hope this explains what I am trying to do. Thank you
for any help - it is greatly appreciated.
Clay
that they were sentenced(YrMnthday) and the type of Crime
they commited(CategoryNum). There are several other
fields in my main table (tblAdmissions) such as race,
sex, sentence legnth, etc. that I will need to do
calculations on. The data below are the duplicate
DOCNUM's from this table. For our calcualations, we want
to develop reports that will count the number of inmates
by different breakdowns such as race, sex, etc. for each
month of admission.
My problem, is creating a query that will return a DOCNUM
only one time for each sentence date. In the data below
for example, I want to count DOCNUM 73993 twice, because
he was admitted into prison in both Jan. and May.
However, for DOCNUM 81887, he was only admitted one time
in Dec., but for two different Crime Category's. So, for
him, I want to count the MINIMUM CategoryNum...so in his
case, I would only want the 1st record. For DOCNUM
82081, we would want to count only his CategoryNum "1"
crimes for both dates that he was admitted (Nov 29 and
Mar 12).
DOCNUM Cmnt YrMnthday CategoryNum
73993 A 20010525 2
73993 A 20010117 2
81887 A 20011205 1
81887 A 20011205 2
82081 A 20011129 3
82081 A 20010312 1
82081 A 20011129 1
82081 A 20010312 3
I hope this explains what I am trying to do. Thank you
for any help - it is greatly appreciated.
Clay