Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to SELECT and group
Message
 
 
À
07/01/2004 19:03:01
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00864910
Message ID:
00864913
Vues:
13
Try
* Get Tax amount per group
SELECT tax, SUM((Pr.Unit*Quant)*TAX/100) AS TaxAmount, ;
  FROM mytable ;
  GROUP BY tax ;
  INTO CURSOR crsTemp
* Get Total Tax amount
SELECT SUM(TaxAmount) ;
  FROM crsTemp ;
  INTO CURSOR crsTotal
>Hi all,
>
>I have this records in a table
>
>
>+--------+-----------+---------+--------+----+
>| Art.   | Descrip.  | Pr.Unit | Quant. |Tax |
>+--------+-----------+---------+--------+----+
>  00001    ABC         12.23      2        1
>  00002    CDS          9.33      1        3
>  00003    C1           2.99      1        2
>  00004    C2           1.44      2        1
>  00005    C3           2.23      1        3
>+--------+-----------+---------+--------+-----+
>
>My question is, how can i group the (Pr.Unit*Quant)*TAX/100 for TAX 1,2,3.. and the Total Value for all TAX 1,2,3,4....
>
>João Batista
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform