Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sum problem
Message
 
À
12/05/2000 10:36:39
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00368840
Message ID:
00369060
Vues:
16
>Hi Jim,
>
>Your query produces better results BUT.... two rows for each T1 record and you cannot distinguish the amounts as to source (T2 OR T3). So if I am trying to construct a view containing Invoice total charges and Invoice total payments as separate fields I am SOL it appears. Looks like it has to be done programatically or thru a series of queries, to build a cursor that can support a grid.
>
>Ken

Ken,

This should work for you;
SELECT T1.Id, "T2" AS SourceTable , SUM(T2.Amount) ;
  FROM T1 INNER JOIN T2 ON T1.ID = T2.Fid ;
 UNION ALL ;
 SELECT T1.ID, "T3" AS SourceTable, SUM(T3.Amount) ;
   FROM T1 INNER JOIN T3 ON T1.ID = T3.Fid ...
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform