Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Loop trough records

Status
Not open for further replies.

EKC

Technical User
Jan 13, 2001
43
0
0
CA
Hi,
I need help solving next problem:
I need to calculate Sum of the QTY from the Table1and store it in a variable.Table1 has OrderID,orderline,reldate,QTY fieldsIt looks like:
Order orderLine reldate QTY
111 1 3/1/01 20
111 1 4/1/01 10
111 1 5/10/01 34
111 2 3/2/01 10
111 2 4/10/01 20
111 3 3/25/01 25
111 3 4/30/01 39
I need to sum QTY for the orderID and orderline I want and as long as reldate<date .I thought about having function
SumQTY=Func(OrderID,orderline,date)
that will for those arguments loop trough Table and as long as The order=OrderID and line=orderline and reldate<date calculate sum of QTy and return result and assign it to that valiable SumOTY.I don't know how to do it
Any help welcomed
Lyn
 
Hi Lyn,

Try:

CALCULATE SUM(qty) FOR order = orderid AND line = orderline AND reldate < date to sumqty


Jim
 
You can use the code ...
SUM(Qty) FOR orderid=myOrder AND orderline = myOrderline and reldate < mydate TO myTotalQty ramani :-9
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top