Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Balance amt using SQL from Parent-Child and GrandMaster
Message
 
To
06/12/2004 07:44:47
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:
00967161
Views:
24
Hi Dorin

>Try this way

Wow, Dorin. At first I thought I was looking at my original SQL refomatted, but then I noticed that CASE and ELSE was sparesly used and it worked.

Can these blocks be put in Stored Procedure in FireBird? If so can the return value straight be used as the cursor field/column. A call something like

SELECT MyStoredProcDr(s.bDrAmt) AS bBalDr, MyStoredProcCr(s.bCrAmt) AS bBalCr

MyStoredProcDr
>  CASE WHEN (s.bDrAmt > 0 AND uf.bCr > 0) THEN s.bDrAmt - uf.bCr
>       WHEN (s.bDrAmt > 0 AND uf.bDr > 0) THEN s.bDrAmt - uf.bDr
>       WHEN (uf.bDr IS NULL AND uf.bCr IS NULL) THEN s.bDrAmt
>       ELSE 0 END AS bBalDr,
MyStoredProcCr
>  CASE WHEN (s.bCrAmt > 0 AND uf.bDr > 0) THEN s.bCrAmt - uf.bDr
>       WHEN (s.bCrAmt > 0 AND uf.bCr > 0) THEN s.bCrAmt - uf.bCr
>       WHEN (uf.bDr IS NULL AND uf.bCr IS NULL) THEN s.bCrAmt
>       ELSE 0 END AS bBalCr
This is just one table now. As soon as I add more tables they will be also be queried and having similar query results, irrespective of the fields the future table contains, the logic and cursor fields will remain the same as for this AccountsJV tables

These cursors then I am planning to club together and then provided to the user for further adjusting entries. I guess I haven't mentioned in the thread but this is for Bill-wise (more like entry-wise) outstanding adjustments module.

Thanks a lot for your help.
Regards
Bhavbhuti
___________________________________________
Softwares for Indian Businesses at:
http://venussoftop.tripod.com
___________________________________________
venussoftop@gmail.com
___________________________________________
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform