Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Balance amt using SQL from Parent-Child and GrandMaster
Message
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:
00967043
Views:
10
Hi Sergey

Thanks for your reposne, here is what I did. I adapted and ran your eg as below right in the FireBird backend.
SELECT t.iID, t.iNo, t.dDt,
        s.bDrAmt - uf.bDr + ut.bCr AS bBalDr,
        s.bCrAmt - uf.bCr + ut.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
    LEFT JOIN uOSAccounts ut
        ON ut.iSID = t.iID
The problem now arises is that I receive null as values bBalDr and bBalCr, for both the records returned. I checked individual values, ut.bCr and utbDr are null in first case (ie. 60-60) and uf.bDr and uf.bCr are null in the second case (ie. 100-60).

Please advise in avoiding null values.
Regards
Bhavbhuti
___________________________________________
Softwares for Indian Businesses at:
http://venussoftop.tripod.com
___________________________________________
venussoftop@gmail.com
___________________________________________
Previous
Reply
Map
View

Click here to load this message in the networking platform