on another note, instead of the long icase statement I would use:
LEFT(CMONTH(dosbegin),3) which now would give you 'Sep'
and you can write the content of a memo field to the summary page
I would run you sql statement before calling the report and scan throu your cursor append the record to the memo field (adding a CRLF after each record) of aonother temp cursor
create cursor cc1 (cSummaryPage M)
append blank
SELECT ;
LEFT(CMONTH(dosbegin),3) AS ReportMonth, ;
YEAR(DOSBegin) AS ReportYear, ;
COUNT(*) AS DOSCnt ;
FROM EligAct ;
WHERE BETWEEN(EligAct.DOSBegin,m.DOSBegin,m.DOSEnd) ;
GROUP BY 2,1 ;
INTO CURSOR ReportCursorSummary
scan
repl cSummaryPage with cSummaryPage + ReportMonth+chr(9)+tran(ReportYear)+CHR(9)+tran(DOSCnt ) +chr(13)+chr(10);
in cc1
end
Peter
>I have this code that creates the result below it. How can I get that information into a report after the detail lines? Do I need to try and get them all on one row, or should I find a way to append them to the cursor that supports the detail?
>
>CLOSE DATABASES
>
>USE c:\fmsrun\prompt\EligAct IN 0
>
>m.DOSBegin = DATE() -720
>m.DOSEnd = DATE()
>
>SELECT ;
> ICASE(;
> MONTH(DOSBegin)= 1,'Jan',;
> MONTH(DOSBegin)= 2,'Feb',;
> MONTH(DOSBegin)= 3,'Mar',;
> MONTH(DOSBegin)= 4,'Apr',;
> MONTH(DOSBegin)= 5,'May',;
> MONTH(DOSBegin)= 6,'Jun',;
> MONTH(DOSBegin)= 7,'Jul',;
> MONTH(DOSBegin)= 8,'Aug',;
> MONTH(DOSBegin)= 9,'Sep',;
> MONTH(DOSBegin)=10,'Oct',;
> MONTH(DOSBegin)=11,'Nov',;
> MONTH(DOSBegin)=12,'Dec','') AS ReportMonth, ;
> YEAR(DOSBegin) AS ReportYear, ;
> COUNT(*) AS DOSCnt ;
> FROM EligAct ;
> WHERE BETWEEN(EligAct.DOSBegin,m.DOSBegin,m.DOSEnd) ;
> GROUP BY ReportYear, ReportMonth ;
> INTO CURSOR ReportCursorSummary
>
>BROWSE LAST
>
>CLOSE DATABASES
>
>CANCEL
>
>
>
>Oct 2007 2
>Aug 2008 9
>Feb 2008 4
>Jul 2008 3
>Sep 2008 20
>
Peter Cortiel