% change in report

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
 
M

Marshall Barton

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top