cakkelides
05-21-2009, 05:09 AM
I am trying to get a query that will return a value of the current record and the value of the immediately preceding record.
The date is contained in a query which contains the values of the portoflia of clients over certain dates. The dates are not consecutive, they are working dates.
The query where the data is located looks like this
Client __DATE___ VALUE
AAA1 02-May-09 €21,320.54
AAA1 05-May-09 €21,418.26
AAA1 06-May-09 €21,267.06
AAA1 07-May-09 €21,310.71
BBB1 02-May-09 €191,298.24
BBB1 05-May-09 €200,705.62
BBB1 06-May-09 €209,719.18
BBB1 07-May-09 €206,822.48
CCC1 02-May-09 €581,510.44
CCC1 05-May-09 €593,714.04
CCC1 06-May-09 €607,035.83
CCC1 07-May-09 €607,726.90
I want a new query that will allow me to calculate the daily return of the portfolia for each client for each date.
In order to do so i will need the value on each specific date - the value of the portofolio on the immediately preceding date. For example for the 05-May-09 the value of the portfolio was €593,714.04. The immediately preceding value was that on the 02-May-09 €581,510.44. The performance was 2.09% for that date.
My problem is that i do not know what function or how to write a code that will instruct ACCESS to get the immediately previous record from the current date.
Any ideas?
The date is contained in a query which contains the values of the portoflia of clients over certain dates. The dates are not consecutive, they are working dates.
The query where the data is located looks like this
Client __DATE___ VALUE
AAA1 02-May-09 €21,320.54
AAA1 05-May-09 €21,418.26
AAA1 06-May-09 €21,267.06
AAA1 07-May-09 €21,310.71
BBB1 02-May-09 €191,298.24
BBB1 05-May-09 €200,705.62
BBB1 06-May-09 €209,719.18
BBB1 07-May-09 €206,822.48
CCC1 02-May-09 €581,510.44
CCC1 05-May-09 €593,714.04
CCC1 06-May-09 €607,035.83
CCC1 07-May-09 €607,726.90
I want a new query that will allow me to calculate the daily return of the portfolia for each client for each date.
In order to do so i will need the value on each specific date - the value of the portofolio on the immediately preceding date. For example for the 05-May-09 the value of the portfolio was €593,714.04. The immediately preceding value was that on the 02-May-09 €581,510.44. The performance was 2.09% for that date.
My problem is that i do not know what function or how to write a code that will instruct ACCESS to get the immediately previous record from the current date.
Any ideas?