Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Balance amt using SQL from Parent-Child and GrandMaster
Message
From
06/12/2004 03:41:43
Dorin Vasilescu
ALL Trans Romania
Arad, Romania
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 6 SP5
Miscellaneous
Thread ID:
00966900
Message ID:
00967055
Views:
14
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform