Hi and Happy New Year to all !
I was given this DB2 SQL subquery to convert to Crystal Reports 8.5. My company won't allow me to create a SP or View and want to know what other options I have. Here is the SQL subquery:
select A.CONTRACT_NUMBER, A.AGENT_ID, B.DIST_GRP_NAME
from NEW_BUS A
inner join ADVISOR B on A.AGENT_ID = B.AGENT_ID
where A.TRANS_TYPE = 'APPLIED'
and B.DIST_GRP_NAME <> 'ICA'
and A.CONTRACT_NUMBER not in
(select C.CONTRACT_NUMBER
from NEW_BUS C
where C.TRANS_TYPE in ('NPW', 'NEW ISSUE));
The CONTRACT_NUMBER can have many different TRANS_TYPE values (i.e. Applied, NPW, New Issue, etc...) in the same table NEW_BUS. I want Crystal Reports to print only the CONTRACT_NUMBERs that have Applied only and that the same CONTRACT_NUMBER does not have a NPW or New Issue.
I was thinking of using a subreport. My main report will contain the first select statement and my subreport will contain the subselect. But the linking may not work because it will give me all CONTRACT_NUMBERs with TRANS_TYPE of Applied, NPW, or NEW Issue. Right?
What are the other options I have and would appreciate if you gave me an example?
Thank you very much!
I was given this DB2 SQL subquery to convert to Crystal Reports 8.5. My company won't allow me to create a SP or View and want to know what other options I have. Here is the SQL subquery:
select A.CONTRACT_NUMBER, A.AGENT_ID, B.DIST_GRP_NAME
from NEW_BUS A
inner join ADVISOR B on A.AGENT_ID = B.AGENT_ID
where A.TRANS_TYPE = 'APPLIED'
and B.DIST_GRP_NAME <> 'ICA'
and A.CONTRACT_NUMBER not in
(select C.CONTRACT_NUMBER
from NEW_BUS C
where C.TRANS_TYPE in ('NPW', 'NEW ISSUE));
The CONTRACT_NUMBER can have many different TRANS_TYPE values (i.e. Applied, NPW, New Issue, etc...) in the same table NEW_BUS. I want Crystal Reports to print only the CONTRACT_NUMBERs that have Applied only and that the same CONTRACT_NUMBER does not have a NPW or New Issue.
I was thinking of using a subreport. My main report will contain the first select statement and my subreport will contain the subselect. But the linking may not work because it will give me all CONTRACT_NUMBERs with TRANS_TYPE of Applied, NPW, or NEW Issue. Right?
What are the other options I have and would appreciate if you gave me an example?
Thank you very much!