Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding quantity in free table
Message
 
 
To
20/12/2006 09:48:17
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01178051
Message ID:
01179194
Views:
10
Sam,

As I understood you have two tables: Rejects and OrderMaster. How are they related?


>Hi Naomi,
>
>Here is what I have so far. I am not sure if my scan would update my VendorPerf to get the correct OnTime value. In my SELECT statement, I have initialized my OnTime = 0. When I BROWSE my data before going into my report, I still get zeros in my OnTime field. Please advise...
>
>Thanks,
>Sam
>
>
>* Get the PO Entry here...
>SELECT * FROM rejects ;
>WHERE daterecv BETWEEN StartDate AND EndDate ;
>ORDER BY vendorname, daterecv ;
>INTO CURSOR VendorPerf
>
>SELECT ;
> vendorID, ;
> vendorname, ;
> cnt(*) as NumRect, ;
> sum(qtyrecv) as RecvQty, ;
> sum(qtyrej) as RejQty, ;
> Round(100*SUM(qtyrej)/SUM(qtyrecv),2) as PerRej, ;
> 0 as OnTime ;       && added this for OT field...
> FROM rejects GROUP BY 1 ;
> WHERE daterecv BETWEEN StartDate AND EndDate ;
> INTO CURSOR VendorPerf
>
>* Calculate % On Time here...
>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
>
> scan
>   INSERT INTO VendorPerf(vendorname, OnTime) ;
>   VALUES (vendor, OnTime)
> endscan
>
> SELECT VendorPerf
> SKIP
>enddo
>
>
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform