Using Crystal Reports 10 on Oracle 9i.
I have created a report that passes a date and a system ID to a subreport to for processing.
In the subreport, I have created a (clumbsy I admit) record select formula that basically searches 30 prior to the record and to the end of the month the record occurs in. It is as follows:
local NumberVar EndDate;
local StringVar Temp;
if (Month ({?Pm-TROUBLEINSTANCETABLE.FAILUREENDDATE})=1 or
Month ({?Pm-TROUBLEINSTANCETABLE.FAILUREENDDATE})= 3 or
Month ({?Pm-TROUBLEINSTANCETABLE.FAILUREENDDATE})= 5 or
Month ({?Pm-TROUBLEINSTANCETABLE.FAILUREENDDATE})= 7 or
Month ({?Pm-TROUBLEINSTANCETABLE.FAILUREENDDATE})= 8 or
Month ({?Pm-TROUBLEINSTANCETABLE.FAILUREENDDATE})= 10 or
Month ({?Pm-TROUBLEINSTANCETABLE.FAILUREENDDATE})= 12)
then EndDate := 31
else if (Month ({?Pm-TROUBLEINSTANCETABLE.FAILUREENDDATE})= 4 or
Month ({?Pm-TROUBLEINSTANCETABLE.FAILUREENDDATE})= 6 or
Month ({?Pm-TROUBLEINSTANCETABLE.FAILUREENDDATE})= 9 or
Month ({?Pm-TROUBLEINSTANCETABLE.FAILUREENDDATE})= 11)
then EndDate :=30
else EndDate :=28;
Temp := CStr(Year({?Pm-TROUBLEINSTANCETABLE.FAILUREENDDATE}),0,"") + '/' + CStr(Month({?Pm-TROUBLEINSTANCETABLE.FAILUREENDDATE}),0)+ '/' + CStr(EndDate,0);
{TROUBLEINSTANCETABLE.FAILUREENDDATE} in {?Pm-TROUBLEINSTANCETABLE.FAILUREENDDATE}-30 to DateValue (Temp)
and
{TROUBLEINSTANCETABLE.TID} = {?Pm-@GroupHeader}
-- @GroupHeader is literally the Group Header from the main report pushed into a formula that is passed to the subreport
However, what I'd like to do is change my main report so that it only passes the earliest record to the subreport and does the manipulation.
I hope this makes sense. I'd even love to do it without doing the subreport buy I can't get it to work without one.
Can anyone help me out with this?
Thanks!
I have created a report that passes a date and a system ID to a subreport to for processing.
In the subreport, I have created a (clumbsy I admit) record select formula that basically searches 30 prior to the record and to the end of the month the record occurs in. It is as follows:
local NumberVar EndDate;
local StringVar Temp;
if (Month ({?Pm-TROUBLEINSTANCETABLE.FAILUREENDDATE})=1 or
Month ({?Pm-TROUBLEINSTANCETABLE.FAILUREENDDATE})= 3 or
Month ({?Pm-TROUBLEINSTANCETABLE.FAILUREENDDATE})= 5 or
Month ({?Pm-TROUBLEINSTANCETABLE.FAILUREENDDATE})= 7 or
Month ({?Pm-TROUBLEINSTANCETABLE.FAILUREENDDATE})= 8 or
Month ({?Pm-TROUBLEINSTANCETABLE.FAILUREENDDATE})= 10 or
Month ({?Pm-TROUBLEINSTANCETABLE.FAILUREENDDATE})= 12)
then EndDate := 31
else if (Month ({?Pm-TROUBLEINSTANCETABLE.FAILUREENDDATE})= 4 or
Month ({?Pm-TROUBLEINSTANCETABLE.FAILUREENDDATE})= 6 or
Month ({?Pm-TROUBLEINSTANCETABLE.FAILUREENDDATE})= 9 or
Month ({?Pm-TROUBLEINSTANCETABLE.FAILUREENDDATE})= 11)
then EndDate :=30
else EndDate :=28;
Temp := CStr(Year({?Pm-TROUBLEINSTANCETABLE.FAILUREENDDATE}),0,"") + '/' + CStr(Month({?Pm-TROUBLEINSTANCETABLE.FAILUREENDDATE}),0)+ '/' + CStr(EndDate,0);
{TROUBLEINSTANCETABLE.FAILUREENDDATE} in {?Pm-TROUBLEINSTANCETABLE.FAILUREENDDATE}-30 to DateValue (Temp)
and
{TROUBLEINSTANCETABLE.TID} = {?Pm-@GroupHeader}
-- @GroupHeader is literally the Group Header from the main report pushed into a formula that is passed to the subreport
However, what I'd like to do is change my main report so that it only passes the earliest record to the subreport and does the manipulation.
I hope this makes sense. I'd even love to do it without doing the subreport buy I can't get it to work without one.
Can anyone help me out with this?
Thanks!