Charges by Sort Code

SELECT
   b.lucode as Code,
   b.remark as Description,
   SUM(a.amount) as Charges
FROM
   sos.rv_charges a JOIN sos.lookups b ON a.sortcode=b.lunum
WHERE
   trandate between '1999-01-01' and TODAY()
GROUP BY b.lucode,b.remark

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.