How to get the quantity of a previous three months?

  • Thread starter Thread starter Gracela Pilots via AccessMonster.com
  • Start date Start date
G

Gracela Pilots via AccessMonster.com

Hi,
I have this problem... I don't know how to do it. I have a report that
show the quantity of the current month and another 3 columns for the 3
previous month?

for example
i choose january as my current month, it will appear in the report will
looks like this


October November December January



Please i really need help... thanks

Gracela
 
Hi,


Use DateDiff (see the help file for details), to get the difference in
month, and then, PIVOT on that result, with a IN(0, 1, 2, 3). That could
define the bulk of the data. For the captions, add a control in the "header"
section, and "push" the month name into it.


? Format( Now(), "mmmm")
March


So, DateAdd( "m", -i, Now )

could be used to subtract "i" months, and the previous format supply thus
the right "caption" for your fields that otherwise would be [0], [1], [2],
....




Hoping it may help,
Vanderghast, Access MVP
 
Back
Top