Skip to Content
0

WebI work out previous months

Mar 09, 2017 at 03:35 PM

58

avatar image

Hi

I am trying to set up a report so that every time I run it the headings will be for the past 6 months e.g.

Current month: March

So the report headings should so: Feb, Jan, Dec, Nov, Oct, Sep

Then when run in May, headings should update to: Apr, March, Feb, Jan, Dec, Nov

Any tips?

10 |10000 characters needed characters left characters exceeded
0
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
AMIT KUMAR
Mar 13, 2017 at 11:33 AM
0

Try this.This is not very good solution but your problem will be resolve with this.

You need to create 6 variables.One for one month display.

I have create for Current Date-6=If(MonthNumberOfYear(CurrentDate())=1) Then "Aug" ElseIf(MonthNumberOfYear(CurrentDate())=2) Then "Sep" ElseIf(MonthNumberOfYear(CurrentDate())=3) Then "Oct" ElseIf(MonthNumberOfYear(CurrentDate())=4) Then "Nov" ElseIf(MonthNumberOfYear(CurrentDate())=5) Then "Dec" ElseIf(MonthNumberOfYear(CurrentDate())=6) Then "Jan" ElseIf(MonthNumberOfYear(CurrentDate())=7) Then "Feb" ElseIf(MonthNumberOfYear(CurrentDate())=8) Then "Mar" ElseIf(MonthNumberOfYear(CurrentDate())=9) Then "Apr" ElseIf(MonthNumberOfYear(CurrentDate())=10) Then "May" ElseIf(MonthNumberOfYear(CurrentDate())=11) Then "Jun" ElseIf(MonthNumberOfYear(CurrentDate())=12) Then "Jul"

Similarly you can create for current month-5 and for others.

Share
10 |10000 characters needed characters left characters exceeded
Simon Taylor-Allan Mar 13, 2017 at 07:59 AM
0

Hi Amit,

Sorry still getting to grips with the forum and didn't realise it takes a day or so to get the question uploaded.

We are using an older version where I am not able to use the MonthPeriod function.

Share
10 |10000 characters needed characters left characters exceeded
Simon Taylor-Allan Apr 04, 2017 at 08:56 AM
0

Amit - Thank you so much! That has worked perfectly.

Share
10 |10000 characters needed characters left characters exceeded