Immediately previous record value by query
Posted on 2006-04-06
Let us say I have a table with field "Name X" with the following values:
I want to create a query with 2 fields, one with the same "NameX" values and the other with exactly the same correspondent values but... with one "step below" (sorry for my English).
I mean I get the query as:
2 0 (to be put)
To make myself clearer: I have to calculate a % variation, therefore I need to calculate:
X_n - X_(n-1) divided by X_(n-1) and I have difficulty in findind the difference between consecutive values dynamically.
What I want? The expression to be used in the created field "NameXOneStepBelow" to get the values as explained.
Thanks a lot,