Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to SELECT and group
Message
 
 
To
07/01/2004 19:03:01
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00864910
Message ID:
00864913
Views:
15
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--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform