G
Guest
I have a simple query that has about 10 fields in it. One of the fields is
called CASENUM. When I run the query, it shows 112 records. I use this data
on a report. What I need help with, is I need to count up the total number
of records in which the CASENUM field does not duplicate. I can run a simple
grouping query and there are 80 records. I need to see the number 80 on the
report. How do I get that calculation on the report if it's not on the
query? The query for the report is not grouped. Here is the code:
SELECT Studies.CASENUM, Studies.MRN, Studies.CPT, PostOcc.dtNoted,
PostopOcc.Desc, PostOcc.ICD9, Outcome.Desc, NCOP.Surgeon_id, NCOP.WoundClass,
Studies.OP_Date, Studies.DisCharge_Date, [Discharge_Date]-[Op_Date] AS
[Length of Stay], Studies.DeadDate, PostOcc.Comments
FROM ((Studies INNER JOIN NCOP ON Studies.CASENUM = NCOP.CaseNum) INNER JOIN
(PostOcc INNER JOIN PostopOcc ON PostOcc.Occurrence = PostopOcc.ID) ON
Studies.CASENUM = PostOcc.CaseNum) LEFT JOIN Outcome ON PostOcc.OutCome =
Outcome.ID
WHERE (((Studies.CPT)="43644" Or (Studies.CPT)="43645" Or
(Studies.CPT)="43659" Or (Studies.CPT)="43842" Or (Studies.CPT)="43843" Or
(Studies.CPT)="43845" Or (Studies.CPT)="43846" Or (Studies.CPT)="43847" Or
(Studies.CPT)="43848" Or (Studies.CPT)="43860") AND ((Studies.OP_Date)
Between #2/1/2004# And #6/30/2005#));
Thanks,
Kim
called CASENUM. When I run the query, it shows 112 records. I use this data
on a report. What I need help with, is I need to count up the total number
of records in which the CASENUM field does not duplicate. I can run a simple
grouping query and there are 80 records. I need to see the number 80 on the
report. How do I get that calculation on the report if it's not on the
query? The query for the report is not grouped. Here is the code:
SELECT Studies.CASENUM, Studies.MRN, Studies.CPT, PostOcc.dtNoted,
PostopOcc.Desc, PostOcc.ICD9, Outcome.Desc, NCOP.Surgeon_id, NCOP.WoundClass,
Studies.OP_Date, Studies.DisCharge_Date, [Discharge_Date]-[Op_Date] AS
[Length of Stay], Studies.DeadDate, PostOcc.Comments
FROM ((Studies INNER JOIN NCOP ON Studies.CASENUM = NCOP.CaseNum) INNER JOIN
(PostOcc INNER JOIN PostopOcc ON PostOcc.Occurrence = PostopOcc.ID) ON
Studies.CASENUM = PostOcc.CaseNum) LEFT JOIN Outcome ON PostOcc.OutCome =
Outcome.ID
WHERE (((Studies.CPT)="43644" Or (Studies.CPT)="43645" Or
(Studies.CPT)="43659" Or (Studies.CPT)="43842" Or (Studies.CPT)="43843" Or
(Studies.CPT)="43845" Or (Studies.CPT)="43846" Or (Studies.CPT)="43847" Or
(Studies.CPT)="43848" Or (Studies.CPT)="43860") AND ((Studies.OP_Date)
Between #2/1/2004# And #6/30/2005#));
Thanks,
Kim