Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
View definition has been changed
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00297945
Message ID:
00298400
Views:
38
>Can you post the SQL that defines the view?

Here it is!

SELECT TranDtl.*, PrcMst.Code AS "PrcMstCode", PrcMst.Descr AS "PrcMstDescr", ;
DfnMst.Code AS "InsMstType", InsMst.Name AS "InsMstName", ;
COUNT(Adjustment.pID) AS "Adjustments", ;
NVL(SUM(Adjustment.Amount),0.00) AS "Credits", ;
NVL(SUM(IIF(INLIST(Adjustment.AdjustType,1,3),Adjustment.Amount,0.00)),0.00) AS "InsCredits", ;
NVL(SUM(IIF(INLIST(Adjustment.AdjustType,2,4),Adjustment.Amount,0.00)),0.00) AS "PatCredits", ;
NVL(TranDtl.InsMstID = TranDtl1.InsMstID,.F.) AS "ReBill", ;
NVL(TranDtl.InsMstID # TranDtl1.InsMstID,.F.) AS "BillOther", ;
TTOD(TranDtl.ServFrDttm) AS "DSort" ;
FROM VCPRO!TranDtl ;
LEFT OUTER JOIN VCPRO!Adjustment ON TranDtl.pID = Adjustment.TranDtlID ;
LEFT OUTER JOIN VCPRO!TranDtl TranDtl1 ON TranDtl.pID = TranDtl1.RefPID ;
INNER JOIN VCPRO!PrcMst ON TranDtl.PrcMstID = PrcMst.pID ;
INNER JOIN VCPRO!InsMst ON TranDtl.InsMstID = InsMst.pID ;
INNER JOIN VCPRO!DfnMst ON InsMst.TypeMstID = DfnMst.pID ;
WHERE TranDTl.PatientID = ?vpPatientID ;
GROUP BY TranDtl.pID ;
ORDER BY DSort DESC, TranDtl.pID DESC
Brien R. Givens

Brampwood Systems
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform