Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

 A change in 2020.4.x broke the Bill Generation grid’s column for “Services w/ MRC” and “Services w/o MRC” columns. PCR is

...

removing these two columns, as was discussed in this previous Forum post. For more information on this change please refer to the Release Notes for 2021.1 or this follow-up Forum post.

Counts of Services on a Bill based on Charge Type

Code Block
languagesql
titleCounts of Services on a Bill based on Charge Type
linenumberstrue
-- This query is valid for MySQL AND Oracle SELECT
DATE_FORMAT(B.BILL_DATE, '%m/%d/%Y') AS BILL_DATE,
CASE WHEN B.TEST_BILL = 0 THEN 'Actual' ELSE 'Test' END AS BILL_TYPE,
BD.CHARGE_TYPE,
COUNT(DISTINCT BTS.SERVICES_RECID) SERVICES_CNT
FROM BILL_DETAILS BD
INNER JOIN BILL_TYPE_SERVICES BTS
ON BD.RECID = BTS.BILL_DETAILS_RECID
INNER JOIN BILLS B
ON B.RECID = BD.BILLS_RECID
WHERE B.TEST_BILL IS NOT NULL
GROUP BY B.RECID, B.BILL_DATE, BD.CHARGE_TYPE

...