Shevshenko
Programmer
I use VFP6 and I have a problem of order when I create a temporary table using SELECT INTO Statement.
The table Lignebl conatains the products of an invoice and I want to select the lines using GROUP BY Lignebl.Ligart which is the productid to SUM the quantities of them.And I want the result in the same order of RECNO() In the table LIGNEBL
So my query is
SELECT LIGNEBL.LIGART , ...... , SUM(LIGNEBL.LIGQTE) AS LIGQTE;
FROM LIGNEBL ;
GROUP BY LIGNEBL.LIGART ;
INTO TABLE TMP_ART
EX : LIGNEBL
Recno(1) Prod1 Qte:2
Recno(2) Prod2 Qte:1
Recno(3) Prod2 Qte:2
Recno(4) Prod1 Qte:1
Recno(5) Prod3 Qte:4
The result in TMP_ART is
Prod2 Qte:3
Prod1 Qte:3
Prod3 Qte:4
And what I want in TMP_ART is
Prod1 Qte:3
Prod2 Qte:3
Prod3 Qte:4
The table Lignebl conatains the products of an invoice and I want to select the lines using GROUP BY Lignebl.Ligart which is the productid to SUM the quantities of them.And I want the result in the same order of RECNO() In the table LIGNEBL
So my query is
SELECT LIGNEBL.LIGART , ...... , SUM(LIGNEBL.LIGQTE) AS LIGQTE;
FROM LIGNEBL ;
GROUP BY LIGNEBL.LIGART ;
INTO TABLE TMP_ART
EX : LIGNEBL
Recno(1) Prod1 Qte:2
Recno(2) Prod2 Qte:1
Recno(3) Prod2 Qte:2
Recno(4) Prod1 Qte:1
Recno(5) Prod3 Qte:4
The result in TMP_ART is
Prod2 Qte:3
Prod1 Qte:3
Prod3 Qte:4
And what I want in TMP_ART is
Prod1 Qte:3
Prod2 Qte:3
Prod3 Qte:4