The following I put in Command and run ok. But the Command creates 1 field here called 0001 and it only displays this '0001' in the report.
But, if you do a browse data, you get the actual count from first part and you get the sum from second. but why cr not displayed that?
SELECT count(*) FROM ASTCCDTA.OEORH48
WHERE OHORDT IN('RTR','INT','SAM')
AND OHREQD <replace(char(current date, iso), '-', '')
AND OHHLDC <> ' '
union
SELECT SUM(OdQty#) FROM ASTCCDTA.OEORH48,ASTDTA.OEORD1
WHERE OHCOM# = ODCOM# AND OHORD# = ODORD#
AND ODPRT# = OdAls# AND substr(odprt#,1,3) <> 'FRT'
AND OHORDT IN('RTR','INT','SAM')
AND OHREQD <replace(char(current date, iso), '-', '')
AND OHHLDC <> ' '