Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Balance amt using SQL from Parent-Child and GrandMaster
Message
 
À
06/12/2004 07:44:47
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:
00967161
Vues:
29
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
___________________________________________
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform