Using Crystal 10.
I need to select patients whose last appointment date > 4/30/2011 and the appointment is not a NOTE and the appointment wasn't canceled.
In looking in the forum I found a SQL statement that addresses the last appointment date part. I tried adding code for the rest of the criteria and came up with:
In the Record Selection:
{Schedule.App_DtTm} = {%LastApptDt}
But it's not working. I am getting appointments that are NOTES and also getting appointment that are before 4/30/2011.
Is this the best way to select these records? If so, how do I fix this statement? If not, what other method would work better?
TIA!
~RLG
I need to select patients whose last appointment date > 4/30/2011 and the appointment is not a NOTE and the appointment wasn't canceled.
In looking in the forum I found a SQL statement that addresses the last appointment date part. I tried adding code for the rest of the criteria and came up with:
Code:
(
select max("App_DtTm")
from Schedule A
where A."Pat_ID1"="Schedule"."Pat_ID1" and
"Schedule"."Activity" <> 'NONE' and
("Schedule"."SchStatus_Hist_SD" <> 'N' or
"Schedule"."SchStatus_Hist_SD" <> 'X') and
("Schedule"."App_DtTm" >= {fn MONTH(05)} and
"Schedule"."App_DtTm" >= {fn YEAR(2011)})
)
In the Record Selection:
{Schedule.App_DtTm} = {%LastApptDt}
But it's not working. I am getting appointments that are NOTES and also getting appointment that are before 4/30/2011.
Is this the best way to select these records? If so, how do I fix this statement? If not, what other method would work better?
TIA!
~RLG