select a.*, b.PresRef, b.MedName, b.OrderDate, b.PhysRef; from Physicals a, Prescriptions b; into cursor ViewPhysicalsReport nofilter; where a.Healthnum = mRepHealthNum .and.; a.Date = mPhysicalsDate .and.; b.PhysRef = a.PhysRef; order by a.PatientNam, a.HealthNum, a.PhysRef, b.MedNameDesired Report:
REPORT HEADING Report Date: Doctor: Patient Name: Date of Physicals: _____________________________________________________________ BP: HR: etc........ General Appearance: Head and Neck: ...... ...... (all from physicals table) Prescriptions: (list all medications prescribed) Labtests: (list all labtests ordered) (this is the 3rd table) Diagnosis: (from Physicals table) Management: (from Physicals table) Progress: (from Physicals table) ____________________________________________________________ Page numberRelationship: All tables are related by date and PhysRef.