Mike Hughes
Registered User.
- Local time
- Today, 12:42
- Joined
- Mar 23, 2002
- Messages
- 493
When I try running this query I get
"Data Type Mismatch in criteria expression"
This is a query I had originaly written for a program called "Query Reporter"
I'm trying to move it over to Access
Any ideas?
Select
b.worker_id,
iv_d_do_code,
a.id_payor,
b.case_id,
a.dt_batch,
a.cd_source_batch,
a.no_batch,
a.seq_receipt,
cd_reason_status,
sum(a.amt_to_distribute) AS Held_amt
From
noldba_receipt a,
noldba_int_case_status b
Where A.Cd_Status_Receipt = 'H'
And iv_d_do_code IN('KK','LL','MM','NN')
AND a.cd_source_batch<>'I'
And A.Dt_Distribute = '12/31/9999'
And A.Dt_End_Validity = '12/31/9999'
AND Not Exists (Select 1 from noldba_receipt k
where a.dt_batch = k.dt_batch
ANd a.no_batch = k.no_batch
And a.cd_source_batch = k.cd_source_batch
And a.seq_receipt = k.seq_receipt
And k.ind_backout = 'Y'
And k.dt_end_validity = '12/31/9999')
And ((trim(A.Id_Case) IS NOT NULL
AND A.Id_case = b.case_id )
Or
( trim(A.Id_Case) IS NULL
ANd b.case_id = (Select Min(y.case_id) from noldba_int_case_status Y, noldba_int_case_member Z
Where A.Id_Payor = z.member_id
And z.relation_code IN ('A','P')
And z.case_id = y.case_id )
))
group by b.worker_id,iv_d_do_code,a.id_payor,b.case_id,a.dt_batch,a.cd_source_batch,
a.no_batch,a.seq_receipt,cd_reason_status
order by iv_d_do_code, b.worker_id
"Data Type Mismatch in criteria expression"
This is a query I had originaly written for a program called "Query Reporter"
I'm trying to move it over to Access
Any ideas?
Select
b.worker_id,
iv_d_do_code,
a.id_payor,
b.case_id,
a.dt_batch,
a.cd_source_batch,
a.no_batch,
a.seq_receipt,
cd_reason_status,
sum(a.amt_to_distribute) AS Held_amt
From
noldba_receipt a,
noldba_int_case_status b
Where A.Cd_Status_Receipt = 'H'
And iv_d_do_code IN('KK','LL','MM','NN')
AND a.cd_source_batch<>'I'
And A.Dt_Distribute = '12/31/9999'
And A.Dt_End_Validity = '12/31/9999'
AND Not Exists (Select 1 from noldba_receipt k
where a.dt_batch = k.dt_batch
ANd a.no_batch = k.no_batch
And a.cd_source_batch = k.cd_source_batch
And a.seq_receipt = k.seq_receipt
And k.ind_backout = 'Y'
And k.dt_end_validity = '12/31/9999')
And ((trim(A.Id_Case) IS NOT NULL
AND A.Id_case = b.case_id )
Or
( trim(A.Id_Case) IS NULL
ANd b.case_id = (Select Min(y.case_id) from noldba_int_case_status Y, noldba_int_case_member Z
Where A.Id_Payor = z.member_id
And z.relation_code IN ('A','P')
And z.case_id = y.case_id )
))
group by b.worker_id,iv_d_do_code,a.id_payor,b.case_id,a.dt_batch,a.cd_source_batch,
a.no_batch,a.seq_receipt,cd_reason_status
order by iv_d_do_code, b.worker_id