Revision [212]
Last edited on 2009-01-22 17:20:17 by SethKriegerAdditions:
======Payments by Service and Sort Code for Period======
I need a break down of payments totalled by Service Code and Sort Code. We use the SortCode field on the Charge entry to indicate the facility where the services were rendered.
SELECT
srvcode, COALESCE(lucode,'None') AS "Facility", sum(crsplamt) AS Payments
FROM
rv_creditsplits a LEFT OUTER JOIN lookups b ON a.srv_sortcode = b.lunum
WHERE
CredType <> 'Adjustment'
AND
Srv_Date BETWEEN '2008-01-01' and '2008-12-31'
GROUP BY
srvcode, "Facility"
ORDER BY
srvcode, "Facility"
I need a break down of payments totalled by Service Code and Sort Code. We use the SortCode field on the Charge entry to indicate the facility where the services were rendered.
SELECT
srvcode, COALESCE(lucode,'None') AS "Facility", sum(crsplamt) AS Payments
FROM
rv_creditsplits a LEFT OUTER JOIN lookups b ON a.srv_sortcode = b.lunum
WHERE
CredType <> 'Adjustment'
AND
Srv_Date BETWEEN '2008-01-01' and '2008-12-31'
GROUP BY
srvcode, "Facility"
ORDER BY
srvcode, "Facility"
Deletions:
comments here appear in italics
paste your tested query here