• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2577
  • Last Modified:

Identify the first and last day of the current month in Crystal Reports

I am using the following code in a formula field in Crystal Reports (ver. 8.5):

Local DateVar Start := Date (2008,02,01); // place your Starting Date here
Local DateVar End := Date (2008,02,29);  // place your Ending Date here

In this example I statically set the Start date to February 1, 2008 and the End date to February 29, 2008. The variables get used elsewhere. What I need to do is have the Start and End dates dynamically change to whatever the current month is using "currentdate" in Crystal. Anyone know how to do that?
1 Solution
Change your logic to set the dates to this:

Local DateTimeVar Start := minimum(monthtodate);
Local DateTimeVar End := dateadd("m",1,Start) - 1;
rayrover00Author Commented:

That was awesome!! Thanks!

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now