I have these two queries that I need to make into a single query. Keyfield1 and TPOLNO should be the join fields. How would I go about making this a single query?
SELECT TPOLNO, SUM(TTSAMT) AS SUM FROM PFPOSTR410 WHERE
((TTRNYY=2012 AND TTRNMM=3 AND TTRNDD>=27) OR (TTRNYY=2012 AND TTRNMM>3) OR
(TTRNYY=2013 AND TTRNMM<=2) OR (TTRNYY=2013 AND TTRNMM=3 AND TTRNDD<=27))
GROUP BY TPOLNO HAVING SUM(TTSAMT)>=5000 ORDER BY TPOLNO ASC
SELECT KEYFIELD1, KEYFROBJ FROM CMRELATN WHERE RELROLETC=8
Thanks in advance for any direction!
- Josh