>Hi Cetin,
>
>I am not sure what you mean by your question, but the rejects.dbf is a table from maxdata and the cursor I created to hold the data is VendorPerf.
>
>Regards,
>Sam
Samuel,
If you don't have a correct version of your table anymore (without duplicates) you may try to use one of the solutions from FAQ #8129.
For OnTime calculation as per your e-mail:
SELECT * from rejects ;
where daterecv between StartDate and EndDate ;
order by vendorname,daterecv ;
into cursor OrderRejects
do while Vendor = VendorPerf.vendorname
SELECT OrderMaster
SET KEY TO VendorPerf.Ordernum
LOCATE FOR LINNUM_10 = VendorPerf.Linnum AND ;
DELNUM_10 = VendorPerf.Delnum
if found()
numDays = weekdays(VendorPerf.daterecv,OrderMaster.CURDUE_10)
if numDays < Tolerance
OnTime = OnTime + 1
endif
OnTime = Round((OnTime/NumRect)*100,2)
endif
I think we can add OT directly into select specified by Ed, though I don't like using UDFs in SQL.
It's probably better to scan the current VendorPerf cursor and replace OT using the above algorithm.
If it's not broken, fix it until it is.
My Blog