Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Running Total - Summary Data
Message
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Running Total - Summary Data
Divers
Thread ID:
00726469
Message ID:
00726469
Vues:
37
I have following data in SQL Server:
InventTrans:

RecId Loct Batch Qty  TType
1     AAA  001    20  Rec
2     AAA  001    30  Rec
3     BBB  002    20  Rec
4     BBB  002    30  Rec
5     AAA  001    -9  Isu
6     CCC  001     0  Mov
7     CCC  002     0  Mov
I would like to get a result set as below through SQLExec(), which I get in VFP by
SELECT RecId, Loct,Batch,sum(Qty) ;
FROM InventTrans ;
GROUP BY Batch

RecId Loct Batch Qty
6     CCC  001    41
7     CCC  002    50
I tried to run above on SQL Server, but it requires Loct column to be aggregated, which I don't want to do, since I could have any value in it, but I want the last Loct in the result set. Could you suggest a way of doing above by SQLExec()?

Thank you,
Yashkamal Patel
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform