Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Balance amt using SQL from Parent-Child and GrandMaster
Message
De
06/12/2004 03:41:43
Dorin Vasilescu
ALL Trans Romania
Arad, Roumanie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 6 SP5
Divers
Thread ID:
00966900
Message ID:
00967055
Vues:
11
This message has been marked as the solution to the initial question of the thread.
Hi
You can use CASE/ELSE in Firebird
SELECT 'Accounts J.V.            ' AS cFlag, t.iID, t.cBk, t.iNo, t.dDt,
        s.bDrAmt,
        s.bCrAmt,
        uf.bDr, uf.bCr,
        CASE WHEN ( s.bDrAmt + uf.bDr - uf.bCr > 0 ) THEN s.bDrAmt + uf.bDr - uf.bCr ELSE 0 END AS bBalDr ,
        CASE WHEN ( s.bCrAmt + uf.bCr - uf.bDr > 0 ) THEN s.bCrAmt + uf.bCr - uf.bDr ELSE 0 END AS bBalCr
    FROM tAccountsJV t
    JOIN sAccountsJV s
        ON s.iPID = t.iID
            AND s.iAcctID = 485
    LEFT JOIN uOSAccounts uf
        ON uf.iPID = t.iID OR uf.iSID = t.iID
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform