HI All,
IAm using crystal2008
I have a sql code in which some columns are null but there is value 0 in the column count..which is not displayed in the report.i tried all ways but couldn't figure out solution for this.
If you look at the code in the second half when i use 0 = then it displays in toad as well as in report also..but when there is data..it displays both the data and the 0. I want to display data when there is data..or 0.
SELECT COUNT,
counttype
,
siteid
,
storeloc
FROM ( SELECT COUNT ( * ) AS COUNT,
'NRRETURNNULLWO' counttype,
siteid
,
storeloc
FROM maximo.matusetrans
WHERE matusetrans.issuetype = 'RETURN'
AND matusetrans.refwo IS NULL
AND matusetrans.transdate >= TO_DATE (:startdate)
AND matusetrans.transdate <= SYSDATE
GROUP BY siteid, storeloc)
UNION
(SELECT 0 COUNT,
'NRRETURNNULLWO' counttype,
'siteid' AS siteid,
'storeloc' as storeloc
FROM DUAL
WHERE 0= ( SELECT COUNT ( * ) AS COUNT
FROM maximo.matusetrans
WHERE matusetrans.issuetype = 'RETURN'
AND matusetrans.refwo IS NULL
AND matusetrans.transdate >= TO_DATE (:startdate)
AND matusetrans.transdate <= SYSDATE) )
Thanks
Swapna