Crystal 8.5
Advantage SQL
I’m designing a daily appointment schedule printout for medical office mgmt software. Primary table is APPT.DBF with left outer joins to PATIENT.DBF (for patient name and date of birth) and APPTCMTS (for appointment comments).
Parameters are Appointment Date, Location, Department, ID and Filter – all referencing fields that reside in the primary table.
The report has one Group based upon appointment time to separate AM from PM appointments.
Each time I print, it appears that Crystal is chugging through every record in the APPT.DBF before coming to the correct Date/Location/Department/ID combination, then displays the daily schedule. Have included the SQL statement in case it includes something that might shed light on how I can improve the report generation speed.
APPT.DBF is indexed on Appointment Date.
Thanks for the assistance...Ellen
SELECT
APPT."PAT_ID", APPT."DATE", APPT."TIME", APPT."LOCATION", APPT."DOCTOR", APPT."NAME", APPT."REASON", APPT."REMARKS", APPT."APPTSTAT", APPT."COMMENTS", APPT."DEPT",
APPTCMTS."NOTES",
PATIENT."BIRTH", PATIENT."BILL_ID"
FROM
{oj ("APPT" "APPT" LEFT OUTER JOIN "APPTCMTS" "APPTCMTS" ON ((("APPT"."LOCATION"="APPTCMTS"."LOCATION") AND ("APPT"."DEPT"="APPTCMTS"."DEPT")) AND ("APPT"."DOCTOR"="APPTCMTS"."DOCTOR")) AND ("APPT"."DATE"="APPTCMTS"."DATE")) LEFT OUTER JOIN "PATIENT" "PATIENT" ON "APPT"."PAT_ID"="PATIENT"."PAT_ID"}
WHERE
APPT."DATE" = '08/30/20'
ORDER BY
"APPT"."TIME" ASC
Advantage SQL
I’m designing a daily appointment schedule printout for medical office mgmt software. Primary table is APPT.DBF with left outer joins to PATIENT.DBF (for patient name and date of birth) and APPTCMTS (for appointment comments).
Parameters are Appointment Date, Location, Department, ID and Filter – all referencing fields that reside in the primary table.
The report has one Group based upon appointment time to separate AM from PM appointments.
Each time I print, it appears that Crystal is chugging through every record in the APPT.DBF before coming to the correct Date/Location/Department/ID combination, then displays the daily schedule. Have included the SQL statement in case it includes something that might shed light on how I can improve the report generation speed.
APPT.DBF is indexed on Appointment Date.
Thanks for the assistance...Ellen
SELECT
APPT."PAT_ID", APPT."DATE", APPT."TIME", APPT."LOCATION", APPT."DOCTOR", APPT."NAME", APPT."REASON", APPT."REMARKS", APPT."APPTSTAT", APPT."COMMENTS", APPT."DEPT",
APPTCMTS."NOTES",
PATIENT."BIRTH", PATIENT."BILL_ID"
FROM
{oj ("APPT" "APPT" LEFT OUTER JOIN "APPTCMTS" "APPTCMTS" ON ((("APPT"."LOCATION"="APPTCMTS"."LOCATION") AND ("APPT"."DEPT"="APPTCMTS"."DEPT")) AND ("APPT"."DOCTOR"="APPTCMTS"."DOCTOR")) AND ("APPT"."DATE"="APPTCMTS"."DATE")) LEFT OUTER JOIN "PATIENT" "PATIENT" ON "APPT"."PAT_ID"="PATIENT"."PAT_ID"}
WHERE
APPT."DATE" = '08/30/20'
ORDER BY
"APPT"."TIME" ASC