Payments by Place of Service and Year

SELECT 
   year(c.trandate) as YEAR,
   defcode as POS,
   sum(crsplamt) as "TOTAL PAID"
FROM 
   sos.jcrsplits a
   join sos.jcredits b
   join sos.journal c
   join sos.rv_charges d on a.chgsplnum=d.chgsplnum
   join sos.poscodes e on d.poscodenum=e.poscodenum
WHERE 
   b.credtype <> 'Adjustment'
GROUP BY year,pos
ORDER BY year,pos

Leave a Reply

Your email address will not be published.

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.