I am writing a crystal report that will track “CS” services provided to clients. Each client must have at least two “CS” services within a month, however the two services can not be on the same date. In the report I am listing each staff person and each client assigned to them.
My report is grouped as follows:
Group 1 Staff_assignment.StaffID
Group 2 Tx_history.patid
Group 3 Tx_history.patid
I am displaying on group 3 date of service, Patient ID , Patient name, staff name & ID, Previous date of service (Previous({tx_history_all.date_of_service})).
I have created a simple array to store the dates of service and service codes.
//DetailsStringArray
whileprintingrecords;
global stringvar STRING1;
global stringvar STRING2;
shared numbervar counter;
counter:=counter+1;
counter/100;
STRING1:= STRING1 & "," & {tx_history_all.date_of_service};
STRING2:= STRING2 & "," & {tx_history_all.SERVICE_CODE};
Which displays data as:
,10/17/2007,10/17/2007,10/23/2007,10/31/2007,11/15/2007,11/21/2007,11/26/2007,11/26/2007,11/28/2007,11/29/2007
,CS201,CS207,CS200,CS200,CS200,CS207,CS200,CS207,CS207,CS207
As you can see the most recent data is at the end of the string. I am having considerable trouble getting the information out of this string to compare with the current date of service.
I can get the latest data with this formula :
whileprintingrecords;
global stringvar STRING1;
shared numbervar temp;
shared numbervar temp1;
temp:=(length({@Display Array1}));
temp1:=InStrRev ({@Display Array1},",",temp);
But I am unable to get the date just before that the latest date.
Any help would be appreciated.
My report is grouped as follows:
Group 1 Staff_assignment.StaffID
Group 2 Tx_history.patid
Group 3 Tx_history.patid
I am displaying on group 3 date of service, Patient ID , Patient name, staff name & ID, Previous date of service (Previous({tx_history_all.date_of_service})).
I have created a simple array to store the dates of service and service codes.
//DetailsStringArray
whileprintingrecords;
global stringvar STRING1;
global stringvar STRING2;
shared numbervar counter;
counter:=counter+1;
counter/100;
STRING1:= STRING1 & "," & {tx_history_all.date_of_service};
STRING2:= STRING2 & "," & {tx_history_all.SERVICE_CODE};
Which displays data as:
,10/17/2007,10/17/2007,10/23/2007,10/31/2007,11/15/2007,11/21/2007,11/26/2007,11/26/2007,11/28/2007,11/29/2007
,CS201,CS207,CS200,CS200,CS200,CS207,CS200,CS207,CS207,CS207
As you can see the most recent data is at the end of the string. I am having considerable trouble getting the information out of this string to compare with the current date of service.
I can get the latest data with this formula :
whileprintingrecords;
global stringvar STRING1;
shared numbervar temp;
shared numbervar temp1;
temp:=(length({@Display Array1}));
temp1:=InStrRev ({@Display Array1},",",temp);
But I am unable to get the date just before that the latest date.
Any help would be appreciated.