Active Patient Balances Sorted by Primary Provider

Our practice has 40+ therapists and we would like to be able to give
them a simple monthly report showing account balances due by patients.

SELECT
  prv.provcode AS "primary provider", pt.lastname, pt.firstname, pt.id, bal.ptbalance
FROM
  sos.patients pt
  JOIN sos.providers prv ON pt.providernum = prv.providernum
  JOIN sos.PT_NONINSBALANCE bal ON pt.ptnum = bal.ptnum
WHERE
  pt.flag = 0
  AND pt.dischargedate IS NULL
  AND pt.licnum = 101
ORDER BY "primary provider"

 

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This site uses Akismet to reduce spam. Learn how your comment data is processed.