LevelThought
MIS
I have a Microsoft Access Query that extracts adjustment amounts from a linked Oracle table. Specifically, there are 5 types of adjustments that are recorded within the Oracle table in a field titled "Adjustment Amount" with a unique transaction code; Charge Adj (code 4600), Review Adj (code 4700), Vendor Adj (code 4800), Mfg Adj (code 4900), and Final Adj (5000).
Current Access SQL is:
SELECT DISTINCTROW ACCOUNT_PAYMENT_DETAIL.ACCOUNT_NO AS AcctNo, ACCOUNT_PAYOR.ACCOUNT_ID AS AcctCurrent, ACCOUNT_DETAILS.ADJUSTMENT_AMOUNT AS ChargeAdj, ACCOUNT_DETAILS.ADJUSTMENT_AMOUNT AS ReviewAdj, ACCOUNT_DETAILS.ADJUSTMENT_AMOUNT AS VendorAdj, ACCOUNT_DETAILS.ADJUSTMENT_AMOUNT AS MfgAdj, ACCOUNT_DETAILS.ADJUSTMENT_AMOUNT AS FinalAdj
FROM CUSTOMER INNER JOIN (((ACCOUNT_PAYMENT_DETAIL INNER JOIN ACCOUNT_PAYOR ON ACCOUNT_PAYMENT_DETAIL.ACCOUNT_NO = ACCOUNT_PAYOR.ACCOUNT_NO) INNER JOIN ACCOUNT_DETAILS ON
ACCOUNT_PAYMENT_DETAIL.ACCOUNT_NO = ACCOUNT_DETAILS.ACCOUNT_NO) INNER JOIN REVIEW_ENCOUNTER ON
(ACCOUNT_PAYOR.ACCOUNT_NO = REVIEW_ENCOUNTER.ACCOUNT_NO) AND (ACCOUNT_DETAILS.ACCOUNT_NO = REVIEW_ENCOUNTER.ACCOUNT_NO) AND (ACCOUNT_PAYMENT_DETAIL.ACCOUNT_NO =
REVIEW_ENCOUNTER.ACCOUNT_NO)) ON CUSTOMER.PATIENT_NO = REVIEW_ENCOUNTER.PATIENT_NO
GROUP BY ACCOUNT_PAYMENT_DETAIL.ACCOUNT_NO, ACCOUNT_PAYOR.ACCOUNT_ID,
REVIEW_ENCOUNTER.TOTAL_CHARGES, REVIEW_ENCOUNTER.EXPECTED_PAYMENT,
ACCOUNT_PAYOR.TOTAL_PAYMENTS, REVIEW_ENCOUNTER.TOTAL_PAYMENTS,
ACCOUNT_DETAILS.ADJUSTMENT_AMOUNT, ACCOUNT_DETAILS.ADJUSTMENT_AMOUNT,
ACCOUNT_DETAILS.ADJUSTMENT_AMOUNT, ACCOUNT_DETAILS.ADJUSTMENT_AMOUNT,
ACCOUNT_DETAILS.ADJUSTMENT_AMOUNT,
CDate(Format([ACCOUNT_PAYMENT_DETAIL].[DATE_INSERTED],"m/d/yy")),
ACCOUNT_DETAILS.TRANSACTION_CODE
HAVING (((ACCOUNT_PAYOR.ACCOUNT_ID) Not In ("FVGB","GVGB","GVGC")) AND
((CDate(Format([ACCOUNT_PAYMENT_DETAIL].[DATE_INSERTED],"m/d/yy")))=Date()-1) AND
((ACCOUNT_DETAILS.TRANSACTION_CODE) In ('4600','4700','4800','4900','5000')))
ORDER BY ACCOUNT_PAYMENT_DETAIL.ACCOUNT_NO, ACCOUNT_PAYOR.ACCOUNT_ID;
Current Results are something similar to:
AcctNo---ChargeAdj---AdjAmt
245VB----10000-------20
245VB----10000-------250
245VB----10000-------10
245VB----10000-------20
Desired results are:
AcctNo---ChargeAdj---ReviewAdj--VendorAdj--MfgAdj--FinalAdj
245VB----10000-------20---------250--------10------20
245VC----20000-------45---------200--------25------25
How should I revise the Access Query within the QBE area to display the different adjustments in separate columns in my results?
Current Access SQL is:
SELECT DISTINCTROW ACCOUNT_PAYMENT_DETAIL.ACCOUNT_NO AS AcctNo, ACCOUNT_PAYOR.ACCOUNT_ID AS AcctCurrent, ACCOUNT_DETAILS.ADJUSTMENT_AMOUNT AS ChargeAdj, ACCOUNT_DETAILS.ADJUSTMENT_AMOUNT AS ReviewAdj, ACCOUNT_DETAILS.ADJUSTMENT_AMOUNT AS VendorAdj, ACCOUNT_DETAILS.ADJUSTMENT_AMOUNT AS MfgAdj, ACCOUNT_DETAILS.ADJUSTMENT_AMOUNT AS FinalAdj
FROM CUSTOMER INNER JOIN (((ACCOUNT_PAYMENT_DETAIL INNER JOIN ACCOUNT_PAYOR ON ACCOUNT_PAYMENT_DETAIL.ACCOUNT_NO = ACCOUNT_PAYOR.ACCOUNT_NO) INNER JOIN ACCOUNT_DETAILS ON
ACCOUNT_PAYMENT_DETAIL.ACCOUNT_NO = ACCOUNT_DETAILS.ACCOUNT_NO) INNER JOIN REVIEW_ENCOUNTER ON
(ACCOUNT_PAYOR.ACCOUNT_NO = REVIEW_ENCOUNTER.ACCOUNT_NO) AND (ACCOUNT_DETAILS.ACCOUNT_NO = REVIEW_ENCOUNTER.ACCOUNT_NO) AND (ACCOUNT_PAYMENT_DETAIL.ACCOUNT_NO =
REVIEW_ENCOUNTER.ACCOUNT_NO)) ON CUSTOMER.PATIENT_NO = REVIEW_ENCOUNTER.PATIENT_NO
GROUP BY ACCOUNT_PAYMENT_DETAIL.ACCOUNT_NO, ACCOUNT_PAYOR.ACCOUNT_ID,
REVIEW_ENCOUNTER.TOTAL_CHARGES, REVIEW_ENCOUNTER.EXPECTED_PAYMENT,
ACCOUNT_PAYOR.TOTAL_PAYMENTS, REVIEW_ENCOUNTER.TOTAL_PAYMENTS,
ACCOUNT_DETAILS.ADJUSTMENT_AMOUNT, ACCOUNT_DETAILS.ADJUSTMENT_AMOUNT,
ACCOUNT_DETAILS.ADJUSTMENT_AMOUNT, ACCOUNT_DETAILS.ADJUSTMENT_AMOUNT,
ACCOUNT_DETAILS.ADJUSTMENT_AMOUNT,
CDate(Format([ACCOUNT_PAYMENT_DETAIL].[DATE_INSERTED],"m/d/yy")),
ACCOUNT_DETAILS.TRANSACTION_CODE
HAVING (((ACCOUNT_PAYOR.ACCOUNT_ID) Not In ("FVGB","GVGB","GVGC")) AND
((CDate(Format([ACCOUNT_PAYMENT_DETAIL].[DATE_INSERTED],"m/d/yy")))=Date()-1) AND
((ACCOUNT_DETAILS.TRANSACTION_CODE) In ('4600','4700','4800','4900','5000')))
ORDER BY ACCOUNT_PAYMENT_DETAIL.ACCOUNT_NO, ACCOUNT_PAYOR.ACCOUNT_ID;
Current Results are something similar to:
AcctNo---ChargeAdj---AdjAmt
245VB----10000-------20
245VB----10000-------250
245VB----10000-------10
245VB----10000-------20
Desired results are:
AcctNo---ChargeAdj---ReviewAdj--VendorAdj--MfgAdj--FinalAdj
245VB----10000-------20---------250--------10------20
245VC----20000-------45---------200--------25------25
How should I revise the Access Query within the QBE area to display the different adjustments in separate columns in my results?