• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 379
  • Last Modified:

MA Access - Salary changes for consequtive dates

To whom it may concern,

My output from a query in MS Access can be found in the attached file. I am trying to perform an operation in MS Access which takes the attached output (in table form) and allows me to calculate the percentage change in salaries between consecutive dates for each individual listed (see As_Of_Date). For example I need MS Access to compute the percentage change for Kevin's salary between 4/9/2010 and 10/5/2011 and then again the percentage change in salary for Kevin between 10/5/2011 and  5/20/2012. For Tom it would be the percentage change in salary between 3/11/2011 and 11/1/2010.

Any help would be appreciated.

1 Solution
SELECT qry.Name, qry.Level, qry.Salary, qry.As_Of_Date, qry_1.Salary, qry_1.As_Of_Date, ([qry].[Salary]-[qry_1].[Salary])/[qry_1].[Salary]*100 AS Perc
FROM qry INNER JOIN qry AS qry_1 ON qry.Name = qry_1.Name
WHERE (((qry_1.As_Of_Date) In (Select TOP 1 As_Of_Date FROM qry as q WHERE q.Name = qry.Name And q.As_Of_Date < qry.[As_Of_Date] Order By q.As_Of_Date DESC)));

Open in new window

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now