Important Content Update Message
We are currently updating the OP Help Center content for the release of OP 20. OP 20 (official version 20.0.x) is the certified, 2015 Edition, version of the Office Practicum software. This is displayed in your software (Help tab > About) and in the Help Center tab labeled Version 20.0. We appreciate your patience as we continue to update all of our content.

SQL: Claims Out to Secondary Insurance


This report shows claims which are “out” to a secondary insurance, along with primary and secondary insurance responsibility dates and aging days (i.e. the elapsed time from the secondary insurance responsibility date to today).

A sample image of this SQL report run in the Database Viewer is shown below:


This SQL looks only for secondary claims with an insurance balance of $0.01 or greater.


To highlight and copy the code below to your clipboard, simply click the Copy button.

select a.invoiceno as claim_number, claimdate as claim_created, patno, ins_carrier_code_1 as primary_ins, ins_carrier_code_2 as secondary_ins, primary_ins_resp_date, secondary_ins_resp_date,  coalesce(days_from_2ary,days_from_1ary,days_from_claim) as aging_days, case when days_from_2ary is null then ins_carrier_code_1 else ins_carrier_code_2 end as out_to from

select invoiceno, claimdate, patno, ins_carrier_code_1, ins_carrier_code_2, primary_ins_resp_date, secondary_ins_resp_date, cast('today' as date)-primary_ins_resp_date as days_from_1ary, 

cast('today' as date)-secondary_ins_resp_date as days_from_2ary, cast('today' as date)-claimdate as days_from_claim,  ins_balance

 from claims1 where ins_balance >= 0.01
) a
where secondary_ins_resp_date is not null