alexfromuno
Programmer
- Nov 6, 2002
- 20
I'm running Crystal 8.5,
Oracle 8.1.7 and can't quite get a sub-query to work in Crystal ( I guess I don't know what I'm doing wrong)
Here's the SQL statement:
select aa.PAT_ID,pd.LAST_NAME,pd.FIRST_NAME, pt.DATE_OF_TRANS, aa.ACTION_SCHEDULED_DATE
from actions aa,
patient_demo pd,
pat_transplant pt
where aa.ACT_ID = 10165
and aa.PAT_ID = pd.PAT_ID
and aa.PAT_ID = pt.PAT_ID
and pt.DATE_OF_TRANS = (select min(pt2.DATE_OF_TRANS)
from pat_transplant pt2
where pt2.ORGAN_TYPE = 4
AND PT2.PAT_ID = pt.pat_id)
order by aa.ACTION_SCHEDULED_DATE
It works fine in SQL dsigner, but, whenever I try and inport a .QRY into Crsytal 8.5 I see no fields to work with
or
when I attempt to cut up the above SQL into a more manageable part to use in Formula Editor I get weried error messages, like 'The ) is missing' and I can't locate the front (.
Anyone out there have an answer, please.
alex
Oracle 8.1.7 and can't quite get a sub-query to work in Crystal ( I guess I don't know what I'm doing wrong)
Here's the SQL statement:
select aa.PAT_ID,pd.LAST_NAME,pd.FIRST_NAME, pt.DATE_OF_TRANS, aa.ACTION_SCHEDULED_DATE
from actions aa,
patient_demo pd,
pat_transplant pt
where aa.ACT_ID = 10165
and aa.PAT_ID = pd.PAT_ID
and aa.PAT_ID = pt.PAT_ID
and pt.DATE_OF_TRANS = (select min(pt2.DATE_OF_TRANS)
from pat_transplant pt2
where pt2.ORGAN_TYPE = 4
AND PT2.PAT_ID = pt.pat_id)
order by aa.ACTION_SCHEDULED_DATE
It works fine in SQL dsigner, but, whenever I try and inport a .QRY into Crsytal 8.5 I see no fields to work with
or
when I attempt to cut up the above SQL into a more manageable part to use in Formula Editor I get weried error messages, like 'The ) is missing' and I can't locate the front (.
Anyone out there have an answer, please.
alex