I'm trying to write a query here that asks what women between 18 and
64 seen in a date range have had a pap smear within 3 years before
their visit. I tried the following, but Fox told me to go fornicate
myself. Anybody have any thoughts on the way it should actually look?
Thanks.
SELECT pid, obsDate, obsName ;
FROM allObs ;
INTO CURSOR crsrWomen1864 ;
WHERE sex = "F" ;
AND dateOfBirt BETWEEN GOMONTH(obsDate, -65 * 12) + 1 ;
AND GOMONTH(obsDate, -18 * 12) ;
AND obsDate BETWEEN ldStart AND ldEnd
SELECT COUNT(distinct o1.pid) as pidCount ;
FROM allObs o1 ;
INTO CURSOR crsrWomenPap3Years ;
WHERE o1.pID in (SELECT pID FROM crsrWomen1864) ;
AND exists ( ;
SELECT obsDate ;
FROM allObs o2 ;
WHERE o2.pID = o1.pID ;
AND o2.obsName = "PAP SMEAR" ;
AND o2.obsDate between
GOMONTH(o1.obsDate, -3 * 12) AND o1.obsDate)
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED]
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.