Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select and sum
Message
De
21/11/2004 11:20:09
 
 
À
21/11/2004 07:36:36
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Divers
Thread ID:
00963216
Message ID:
00963325
Vues:
9
1.how i can get all customers.

Put this code in a customer form method called RefreshGrid(). Call this method whenver you want to change the contents of the grid.
LOCAL ldStart, ldEnd
ldStart = thisform.pageframe1.page1.text3.value
ldEnd = thisform.pageframe1.page1.text5.value

SELECT inname, billno, SUM( total ) AS bill_total FROM Mstr WHERE ;
  BETWEEN( datein, ldStart, ldEnd ) ;
  GROUP BY inname, billno ;
  ORDER BY inname INTO CURSOR qTmp
SELECT csrBillTotals 
ZAP
APPEND FROM DBF( [qTmp] )
Thisform.pageframe1.page1.grid1.refresh()
2.how i can see the result via grid
This goes in the Load() method of the form. Note that you will need to change the data types I have defined so that they match the data types of the fields in your Mstr table.
CREATE CURSOR csrBillTotals (;
  inname C( 30 ), ;
  billno I, ;
  bill_total Y )
Set the grid's RecordSource to csrBillTotals in the form designer

Have you obtained any VFP reference books yet?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform