SQL: Balances with Credit Cards on File

About

This report looks for all patients with balances who also have an active credit card on file (stored in the CC_ON_FILE table).

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

Caveats

None.

Code

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

select register.patno, copaybal from register
left outer join cc_on_file on cc_on_file.patno = register.patno
 where copaybal >= 0.01 and cc_on_file.patno >99 and is_active = 1