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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Diference betwen results

Status
Not open for further replies.

angjbsca

Programmer
May 26, 2006
30
PR
Hi I have this table:

type Qty Qty.DIFF
e 500 200
e 300 100
e 200 0

I need to calculate the third column wich is the dife.
between him and the next record.
 
You need a field that could be used to arrange them in some order, otherwise, you'll get random results. A date field or an EntryID field perhaps (or both).
 
Can you explain more clearly what you want to do? What do you want your results to look like? Ssome sample data please.

Jim
 
Sorry here is my data:
Date Type total Change
5/17 s 5037 -1 =((5/17-5/16)/(5037-5038))
5/16 s 5038 -2 =....
5/15 s 5049 -1 =....
5/12 s 5043 0 =....


Total Change
-6 = 5037-5043(5043= first date value)
-5 = 5038-5043
-3 = 5049-5043
0
If I go to excel thats before is what I do.. I need the fields(Change) and (Total Change)in sql query.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top