I have prepared the following SQL query using the Command function of Crystal 10. It runs OK, however when I check performance I find that grouping and sorting have not been done on the server. Further, it required two passes. When I go to file/report options, the "Group on Server" option is not highlighted (active) so I can't check it. Here's the query:
SELECT view_episode_summary_current.PATID,view_episode_summary_current.program_X_RRG_code,
locus_adult_assessment.functional_status,locus_adult_assessment.rating_date
FROM SYSTEM.view_episode_summary_current view_episode_summary_current LEFT OUTER JOIN
SYSTEM.locus_adult_assessment locus_adult_assessment ON ((view_episode_summary_current.PATID=locus_adult_assessment.PATID)
AND (view_episode_summary_current.EPISODE_NUMBER=locus_adult_assessment.EPISODE_NUMBER))
WHERE ((view_episode_summary_current.program_X_RRG_code={?RRG}) AND (locus_adult_assessment.rating_date IS NOT NULL))
GROUP BY view_episode_summary_current.program_X_RRG_code,view_episode_summary_current.PATID,
locus_adult_assessment.rating_date
ORDER BY view_episode_summary_current.program_X_RRG_code,view_episode_summary_current.PATID,
locus_adult_assessment.rating_date DESC
SELECT view_episode_summary_current.PATID,view_episode_summary_current.program_X_RRG_code,
locus_adult_assessment.functional_status,locus_adult_assessment.rating_date
FROM SYSTEM.view_episode_summary_current view_episode_summary_current LEFT OUTER JOIN
SYSTEM.locus_adult_assessment locus_adult_assessment ON ((view_episode_summary_current.PATID=locus_adult_assessment.PATID)
AND (view_episode_summary_current.EPISODE_NUMBER=locus_adult_assessment.EPISODE_NUMBER))
WHERE ((view_episode_summary_current.program_X_RRG_code={?RRG}) AND (locus_adult_assessment.rating_date IS NOT NULL))
GROUP BY view_episode_summary_current.program_X_RRG_code,view_episode_summary_current.PATID,
locus_adult_assessment.rating_date
ORDER BY view_episode_summary_current.program_X_RRG_code,view_episode_summary_current.PATID,
locus_adult_assessment.rating_date DESC