Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Balance amt using SQL from Parent-Child and GrandMaster
Message
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:
00967050
Vues:
11
Hi Sergey

I had been working on your code in the mean time. I have narrowed it down to the following;
SELECT 'Accounts J.V.            ' AS cFlag, t.iID, t.cBk, t.iNo, t.dDt,
        s.bDrAmt,
        s.bCrAmt,
        uf.bDr, uf.bCr,
        s.bDrAmt + uf.bDr - uf.bCr AS bBalDr,
        s.bCrAmt + uf.bCr - uf.bDr 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
This returns 2 rows but the problem is either bBalDr or bBalCr is right but the other in the same row is wrong dues to the kind of calculation. I tried a IIF() in FireBird but that is not available. Any idea to improve this SQL?

Appreciating your help.
Regards
Bhavbhuti
___________________________________________
Softwares for Indian Businesses at:
http://venussoftop.tripod.com
___________________________________________
venussoftop@gmail.com
___________________________________________
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform