Print Page | Close Window

first and last day of last month

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=20387
Printed Date: 01 May 2024 at 10:11pm


Topic: first and last day of last month
Posted By: Macavity
Subject: first and last day of last month
Date Posted: 23 Jan 2014 at 6:03am
Hi,

I have been changing a bunch of reports to get data from last month

formula:

@firstdaylastmonth : dateserial(year(currentdate),month(currentdate)-1,1)

@lastdaylastmonth : date(year(currentdate),month(currentdate,1)-1

Works perfect in the first ten reports, in the eleventh report :
firstdaylastmonth = 01/05/2006 and lastdaylastmonth = 31/05/2006

?????????

How does that happen ?

thanks




Replies:
Posted By: lolly54
Date Posted: 27 Jan 2014 at 3:48am
If you want to get data from last month, why don't you use lastFullMonth?
Then, you wouldn't need to have the additional two formulas.

In selection criteria:

{@Open Date} in lastFullMonth



Print Page | Close Window