Hi Ed,
I have to add few things to it in order to run the program. My report needs PerRej, the startdate and enddate, and needed to specify vendorname as VenName.
* Start PO Entry Table Query here...
* Get the information here...
StartDate = ctod(THISFORM.txtStartDate.Value)
EndDate = ctod(THISFORM.txtEndDate.Value)
Vendor = THISFORM.txtVendorID.Value
Tolerance = val(THISFORM.txtTolerance.Value)
* Create VendorPerformance cursor to hold the report...
CREATE CURSOR VndrPerf(VendorID C(5), VenName C(25), NumReceipts I, QtyRecv N(10), ;
QtyRej N(6), PerRej B(2), OnTime B(2))
SELECT vendorID, ;
vendorname AS VenName, ;
cnt(*) AS NumReceipts, ;
SUM(qtyrecv) AS QtyRecv, ;
SUM(qtyrej) AS QtyRej, ;
ROUND(100*SUM(QtyRej)/SUM(QtyRecv),2) as PerRej ;
FROM PoEntry ;
WHERE daterecv BETWEEN StartDate AND EndDate ;
INTO CURSOR VndrPerf ;
GROUP BY 1
SELECT VndrPerf
if reccount() = 0
MessageBox("No Records to Display!",64)
else
VpStartDate = StartDate
VpEndDate = EndDate
VpTolerance = Tolerance
REPORT FORM VendorPerf PREVIEW
endif