Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Query is not working
Message
 
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00547605
Message ID:
00547622
Views:
8
It seems, like you have too many fields to compare. Anyway, try this version first (I inserted space between ; and add table aliases to make this SQL shorter):
SELECT hdr.claim_num as Header_Claim, ; 
btch.claim_num as SS_Claim, ;
dtl.line, hdr.batch_num, ;
hdr.pat_lname, hdr.pat_fname,;
dtl.serv_beg, dtl.serv_end, dtl.serv_cpt, ;
dtl.serv_mod, dtl.serv_units, ;
dtl.fee_sched_amt as fee, dtl.allowed_amt as Billed, ;
dtl.provider_pay as prov ;
FROM Batch_rpt btch, _4_claim_temp_header hdr, Claim_Detail dtl ;
where ;
btch.claim = hdr.ins_policy and ;
btch.pat_fname = hdr.pat_fname and ;
btch.pat_lname = hdr.pat_lname and ;
btch.ssn = hdr.enrollee and ;
btch.pre_auth = hdr.prior_auth and ;
btch.end = dtl.serv_end and ;
btch.start = dtl.serv_beg and ;
btch.units = dtl.serv_units and ;
btch.billed = dtl.allowed_amt and ;
btch.fee = dtl.fee_sched_amt and ;
btch.prov = dtl.provider_pay and ;
btch.mod = dtl.serv_mod and ;
btch.code = dtl.serv_cpt and ;
hdr.claim_num = dtl.claim_num and ;
hdr.claim_num <> btch_num and ; 
dtl.serv_cpt <> "E1399" and ;
dtl.remarks2 = "15" ;
ORDER BY hdr.claim_num
>I am trying to run this query, When I run it it gives me program error "Key Invalid Length". Any help.
>Thanks
>Bharat
>
>SELECT _4_claim_temp_header.claim_num as Header_Claim,;
> Batch_rpt.claim_num as SS_Claim,;
> Claim_detail.line, _4_claim_temp_header.batch_num,;
> _4_claim_temp_header.pat_lname, _4_claim_temp_header.pat_fname,;
> Claim_detail.serv_beg, Claim_detail.serv_end, Claim_detail.serv_cpt,;
> Claim_detail.serv_mod, Claim_detail.serv_units,;
> Claim_detail.fee_sched_amt as fee, Claim_detail.allowed_amt as Billed,;
> Claim_detail.provider_pay as prov;
> FROM batch_rpt, _4_claim_temp_header, claim_detail;
> where;
> batch_rpt.claim = _4_claim_temp_header.ins_policy and;
> Batch_rpt.pat_fname = _4_claim_temp_header.pat_fname and;
> Batch_rpt.pat_lname = _4_claim_temp_header.pat_lname and;
> Batch_rpt.ssn = _4_claim_temp_header.enrollee and;
> Batch_rpt.pre_auth = _4_claim_temp_header.prior_auth and;
> Batch_rpt.end = Claim_detail.serv_end and;
> Batch_rpt.start = Claim_detail.serv_beg and;
> Batch_rpt.units = Claim_detail.serv_units and;
> Batch_rpt.billed = Claim_detail.allowed_amt and;
> Batch_rpt.fee = Claim_detail.fee_sched_amt and;
> Batch_rpt.prov = Claim_detail.provider_pay and;
> Batch_rpt.mod = Claim_detail.serv_mod and;
> Batch_rpt.code = Claim_detail.serv_cpt and;
> _4_claim_temp_header.claim_num = Claim_detail.claim_num and;
> _4_claim_temp_header.claim_num <> Batch_rpt.claim_num and;
> Claim_detail.serv_cpt <> "E1399" and;
> Claim_detail.remarks2 = "15" ;
> ORDER BY _4_claim_temp_header.claim_num
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform