• 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?
0
rayrover00
Asked:
rayrover00
1 Solution
 
bdreed35Commented:
Change your logic to set the dates to this:

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

That was awesome!! Thanks!
0

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