% change in report

  • Thread starter Thread starter Peter
  • Start date Start date
P

Peter

I have a report with the following layout.

January Sales (i.e) %change
2001 $100 -
2002 $200 100%
2003 $250 25%
2004 $400 60%

I want another column added to the end that will show the
percentage change in sales from the previous year.
Any advice would be terrific. thanks and have a good day.

Peter
 
Peter said:
I have a report with the following layout.

January Sales (i.e) %change
2001 $100 -
2002 $200 100%
2003 $250 25%
2004 $400 60%

I want another column added to the end that will show the
percentage change in sales from the previous year.


To compare values from two different records, you need to
get the two values into a single record. This can be done
by creating a query that joins the table to itself:

SELECT T.yearfield,
T.Sales,
(T.Sales - X.Sales) / X.Sales) As PctChange
FROM table As T
LEFT JOIN table As X
ON T.yearfield = X.yearfield + 1
 
Back
Top