I have a table with only 2 fields: NAV_Date
and NetAssetValue
.
NAV_Date
is the last day of a quarter.
+----------+--------------+
|NAV_Date |NetAssetValue |
+----------+--------------+
|12/31/2012| $4,000|
+----------+--------------+
|03/31/2013| $5,000|
+----------+--------------+
I am attempting to write a query that subtracts the more recent from the previous. Currently, my query simply selects all values within the table. I know to perform this I would have to retrieve the prior record each time through, however I'm not sure how to do that.
Ultimately I will use ((CurrentValue
/PreviousValue
) - 1) and store the value as a percent to return the difference.
I will also be performing this for yearly values. Does anyone have an example if they did something similar or perhaps a clue to get me started?
The reason I am asking is because I searched for a solution but could not find any useful examples where there was not an autonumber or an ID field.