All,
I am having trouble with a query and would appreciate any help that I could
get. I have 3 tables; immunizations (primary), drug (lookup), and vaccine
(lookup). All tables have a one to one relationship. Anything that is in
the immunization table will also be in the drug table. However, not all
immunizations are vaccines. My problem is that my order by clause is
vaccine.displayseqnbr, immunization.admindate. So, it�s only returning
immunizations that are vaccines. If, I take off the order clause of
vaccine.displayseqnbr, it will return all immunizations. Aside, from
resorting
me result set, is there anyway that I can accomplish the above in Castor?
My original sql:
SELECT
IMMUNIZATION.IMMUNRECORDID, IMMUNIZATION.PATIENTCDRID, IMMUNIZATION.IMMUNID,
IMMUNIZATION.ADMINDATE, IMMUNIZATION.ADMINSITE, IMMUNIZATION.ADMINBY,
IMMUNIZATION.MANUFCODE,
IMMUNIZATION.VACCLOTNBR, IMMUNIZATION.INFOPUBLDATE, IMMUNIZATION.NONDATA,
VACCINE.DISPLAYSEQNBR, VACCINE.MAXDOSE, VACCINE.VACCNAME,
IMMUNDRUG.IMMUNNAME,
IMMUNDRUG.VACCID, IMMUNMANUFAC.MANUFNAME, IMMUNIZATION.EDITSTATUS,
IMMUNIZATION.ADMINDATEMM,
IMMUNIZATION.ADMINDATEDD, IMMUNIZATION.ADMINDATEYYYY
FROM
IMMUNIZATION, IMMUNDRUG, VACCINE, IMMUNMANUFAC
WHERE
IMMUNDRUG.VACCID = VACCINE.VACCID(+) AND
IMMUNIZATION.MANUFCODE = IMMUNMANUFAC.MANUFCODE(+) AND
IMMUNIZATION.IMMUNID = IMMUNDRUG.IMMUNID and
PATIENTCDRID='12345'
order by
VACCINE.DISPLAYSEQNBR asc,IMMUNIZATION.ADMINDATE asc,IMMUNDRUG.IMMUNNAME asc
TIA,
Barbara
_________________________________________________________________
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.
http://join.msn.com/?page=features/virus
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev
