Skip to Content
0

How to run crystal report for Previous month

Jan 05, 2017 at 06:28 AM

90

avatar image

Hi Guys,

I need to run my Crystal Report for Previous month. I want to maintain this in Select Expert not as a Parameter. Also this previous month filter is not just for a measure , it should apply for entire report. Kindly Suggest. I have 0CALDAY and 0CALMONTH.

Regards,

Priyanka.

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

8 Answers

Best Answer
Abhilash Kumar
Jan 05, 2017 at 10:19 AM
0

Could you please post the exact formula you used to get month name?

If you need to display month name, use:

MonthName(Month({Date Field}))

-Abhilash

Share
10 |10000 characters needed characters left characters exceeded
Abhilash Kumar
Jan 05, 2017 at 07:45 AM
0

Hi Priyanka,

Does this report have a 'date' field that can be used in the selection formula?

What is 0CALDAY and 0CALMONTH? Are they Date fields or Number type fields?

-Abhilash

Share
10 |10000 characters needed characters left characters exceeded
Priyanka Choudam Jan 05, 2017 at 08:09 AM
0

Hi Abhilash,

Thanks for Quick Response.

Earlier I used 0CALDAY for previous date data.But now i need to restrict Previous month data using 0CALMONTH.

Those are not fields,but using cdate() and converted to date format.

As of now i'm using this formula for previous month data : {date.field} in date(dateadd('m',-1,minimum(lastfullmonth))) to maximum(lastfullmonth)

but not sure its pulling correct data or not bcoz, when I made it a formula and using monthname() function it is showing "JANUARY" instead of December.

Regards,

Priyanka.

Share
10 |10000 characters needed characters left characters exceeded
Abhilash Kumar
Jan 05, 2017 at 09:43 AM
0

If you only need data for last month, you should use:

{Date Field} IN LastFullMonth

-Abhilash

Share
10 |10000 characters needed characters left characters exceeded
Priyanka Choudam Jan 05, 2017 at 09:55 AM
0

Abhliash,

That's working.

but how do I know that it is December ( I mean Last month ). Bcoz, I used the same formula ({Date Field} IN LastFullMonth) in Monthname() function to display the month name as required,

but it is showing January instead of December.

Need to Display lastmonth name i.e December in report!!!

Regards,

Prinka.

Share
10 |10000 characters needed characters left characters exceeded
Priyanka Choudam Jan 05, 2017 at 10:17 AM
0

Hi Lan,

Actually the Datefield I supposed to use is 0CALDAY which is in STRING format. As of now I converted it using CDATE() function and is fine. But, in this case of monthname display it is throwing error.

Regards,

Priyanka.

Share
10 |10000 characters needed characters left characters exceeded
Ian Waterman Jan 05, 2017 at 10:04 AM
0

Monthname({Date Field}) should return December

Ian

Share
10 |10000 characters needed characters left characters exceeded
Priyanka Choudam Jan 05, 2017 at 10:48 AM
0

Abhilash,

Its working. thanku so much for quick replies.

Regards,

Priyanka.

Share
10 |10000 characters needed characters left characters exceeded