Skip to Content
author's profile photo Former Member
Former Member

Generate Month and Date as part of the Report header

I would like to generate the month (Decemeber) and year (2008) as part of the report header for a report that is generated once a month. I plan on subtracting 10 days from today just to give an accurate month and year since the report will always be run after the last day of the month, So on January 1, the report will be for December, 2008. Can anybody help with this. I am new to Crystal.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 16, 2008 at 09:54 PM

    Great James!! but my year shows up as 2008.00

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Dear John ,

      You can go for subtracting 10 days as well , but again it will have some limitation the report can't be run in the first 10 days of current month and after 11th in next month

      if you are opting for 10 days logic, the formula would be

      "Month: " + monthname(month(dateadd("d", -10, datadate))) + " / " +

      "Year: " + totext(year(dateadd("d", -10, datadate)), "####")

      here d represent days , [ m in previous formula does mean month only]

      dateadd("d, -10 ,datadate) --> returns date subtracting 10 days from current date

      dateadd("m, -1 ,datadate)--> returns date subtarcting 1 month from current date

      year(date)--> returns the Year of Date passed to the function

      but rather than hardcoding try to use parameter fields.explain ur scenario and lets see how can we make it better

      Regard's

      AGR

  • author's profile photo Former Member
    Former Member
    Posted on Dec 16, 2008 at 09:47 PM

    Create a formula such as:

    //{@displaymonthandyear}

    "Month: " + monthname(month(dateadd("m", -1, datadate))) + " / " +

    "Year: " + totext(year(datadate))

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.