Skip to Content

How to run crystal report for Previous month

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

8 Answers

  • Best Answer
    Jan 05, 2017 at 10:19 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 05, 2017 at 07:45 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 05, 2017 at 08:09 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 05, 2017 at 09:43 AM

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

    {Date Field} IN LastFullMonth

    -Abhilash

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 05, 2017 at 09:55 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 05, 2017 at 10:17 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 05, 2017 at 10:04 AM

    Monthname({Date Field}) should return December

    Ian

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 05, 2017 at 10:48 AM

    Abhilash,

    Its working. thanku so much for quick replies.

    Regards,

    Priyanka.

    Add comment
    10|10000 characters needed characters exceeded