Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
View definition has been changed
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00297945
Message ID:
00298400
Vues:
39
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform