cancel
Showing results for 
Search instead for 
Did you mean: 

How to run crystal report for Previous month

former_member290153
Participant
0 Kudos
4,904

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.

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor
0 Kudos

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

Answers (7)

Answers (7)

former_member290153
Participant
0 Kudos

Abhilash,

Its working. thanku so much for quick replies.

Regards,

Priyanka.

former_member290153
Participant
0 Kudos

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.

Former Member
0 Kudos

Monthname({Date Field}) should return December

Ian

former_member290153
Participant
0 Kudos

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.

abhilash_kumar
Active Contributor
0 Kudos

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

{Date Field} IN LastFullMonth

-Abhilash

former_member290153
Participant
0 Kudos

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.

abhilash_kumar
Active Contributor
0 Kudos

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