add column to calculate difference between columns in a crosstab query (1 Viewer)

Access_Help

Registered User.
Local time
Today, 13:40
Joined
Feb 12, 2005
Messages
136
I have 10 columns in a cross tab query each representing a month jan to oct.

I want to add a column to calculate the difference between the numbers in two adjacent columns

For example the difference between jan and feb results
Feb and march
March and april etc
 

CJ_London

Super Moderator
Staff member
Local time
Today, 21:40
Joined
Feb 19, 2013
Messages
16,609
think you will either need to use a second query based on the first (probably the easiest) or have a second crosstab to calculate the difference and then combine with the first crosstab
 

Access_Help

Registered User.
Local time
Today, 13:40
Joined
Feb 12, 2005
Messages
136
Thanks CJ. Do you have an example I can work from?
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 16:40
Joined
Feb 19, 2002
Messages
43,233
Assuming the column names are fixed, create a new query that selects the crosstab query fields. Add 9 new columns and name them
JanFeb, FebMar, MarApr, etc
The calculations would be
Nz(Jan, 0) - Nz(Feb,0)
Nz(Feb, 0) - Nz(Mar,0)
etc
 

Users who are viewing this thread

Top Bottom