Revision [195]
Last edited on 2009-01-06 09:12:15 by SethKriegerNo differences.
Revision [193]
Edited on 2009-01-06 09:09:51 by SethKriegerAdditions:
======Service Count By Provider, Patient Category and Service Code For Period======
I need total # of services rendered broken down by provider, patient category, and service code, for a specific time frame.
SELECT
(a.provfname + ' '+a.provlname) AS "Provider",
c.categcode AS "Category",
a.srvcode AS "Service",
COUNT(DISTINCT jnum) AS "Srv Count"
FROM
rv_charges a
JOIN patients b ON a.ptnum = b.ptnum
LEFT OUTER JOIN ptcategs c ON b.ptcategnum = c.ptcategnum
WHERE
a.trandate BETWEEN '1980-01-01' AND '2008-12-31'
GROUP BY
"Provider","Category","Service"
I need total # of services rendered broken down by provider, patient category, and service code, for a specific time frame.
SELECT
(a.provfname + ' '+a.provlname) AS "Provider",
c.categcode AS "Category",
a.srvcode AS "Service",
COUNT(DISTINCT jnum) AS "Srv Count"
FROM
rv_charges a
JOIN patients b ON a.ptnum = b.ptnum
LEFT OUTER JOIN ptcategs c ON b.ptcategnum = c.ptcategnum
WHERE
a.trandate BETWEEN '1980-01-01' AND '2008-12-31'
GROUP BY
"Provider","Category","Service"
Deletions:
comments here appear in italics
paste your tested query here