We are currently updating the OP Help Center content for the release of OP 14.19 or OP 19. OP 19 is a member of the certified OP 14 family of products (official version is 14.19.1), which you may see in your software (such as in Help > About) and in the Help Center tabs labeled 14.19. You may also notice that the version number in content and videos may not match the version of your software, and some procedural content may not match the workflow in your software. We appreciate your patience and understanding as we make these enhancements.

SQL: One Account Drill Down


This report shows the entire charge and payment activity on a particular chart/account for a specified date range.

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


  • Voids are excluded.
  • The date range refers to the date of service. Payments may have come in any time after the date of service, including time periods after the end date


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

select at1.date1, at1.cptcode, at1.ins_carrier_code, at1.charge, at1.units, at1.trnsxno, at2.ins_paid, at2.pt_paid from
(select date1, cptcode, ins_carrier_code, charge, trnsxno, units from archive_transactions where archive_flag = 1 and date1 between :Start_date and :enddate and patno = :chart_number and cptcode not in ('1','2','3','4')) at1
left outer join
(select sum(payment) as ins_paid, sum(copayrecd) as pt_paid, txnopaid from
(select copayrecd, payment, txnopaid from archive_transactions where archive_flag = 1 and (copayrecd >= 0.01 or payment >= 0.01))
group by txnopaid) at2
on at2.txnopaid = at1.trnsxno