SELECT 'X' AS report_1, ;
reportnames.descript AS descript, ;
ROUND(SUM(IIF(groupcode = groupcode AND !EMPTY(I_L),total, 0)),2) AS Total, ;
reportnames.printorder AS printorder, ;
groupcode AS groupcode, ;
"X" AS I_L ;
FROM Reportnames, Report1 ;
JOIN reportnames ON Report1.printorder= reportnames.printorder;
GROUP BY Report1.Groupcode ;
ORDER BY I_L ;
INTO CURSOR SummaryTable
COPY ALL TO ARRAY gaTempCursor
reportnames
table needs to be in the select
's from
clause.reportnames
. If you moved to the 5th record, e.g., you would get that description in all records of the result. The end result is just like using 'X' as report_1
.reportnames
table and report1
table should be joined on, so I put in report_1
as an example.select
- I have aliased the group by
field as an example.>**-- SECTION 2: Copies and calculates all data into a cursor --** >SELECT 'X' AS report_1, ; > reportnames.descript AS descript, ; > ROUND(SUM(IIF(groupcode = groupcode AND !EMPTY(I_L),total, 0)),2) AS Total, ; > printorder AS printorder, ; > groupcode AS groupcode, ; > "X" AS I_L ; > FROM Report1 ; > Join reportnames On Report1.report_1 = reportnames.report_1 ; > GROUP BY Report1.Groupcode ; > ORDER BY I_L ; > INTO CURSOR SummaryTable>HTH