Last post Mar 13, 2008 09:56 AM by naredlaa
Mar 05, 2008 11:35 AM|naredlaa|LINK
I am trying to get calcualtion using MS Access query, Average of current row and preceding row.
e.g i have three columns YEAR,MONTH, SALARY
2000 01 1000
2000 02 1100
2000 03 1200
i am trying to get an AVERAGE SALARY Column; an average of current row and 1 preceding row(if any)
1000 i.e. 1000/1
1050 i.e. (1000+1100)/2
1150 i.e (1100 + 1200)/2
is there a math function or any MS Access function that does above functionality ?
Mar 06, 2008 02:54 AM|Mikesdotnetting|LINK
I think the best way to do this is just to extract the raw data from the database into a DataSet, then use VB or C# in the code-behind or whatever to perform this kind of calculation on the values in the DataSet.
Mar 13, 2008 09:56 AM|naredlaa|LINK
Carrying over to code behind would be time consuming. I got it worked making JOINS on itself.