Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select and sum
Message
From
21/11/2004 11:20:09
 
 
To
21/11/2004 07:36:36
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00963216
Message ID:
00963325
Views:
10
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?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform