Print Page | Close Window

Last 2 months to current date

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=12055
Printed Date: 05 May 2024 at 4:13pm


Topic: Last 2 months to current date
Posted By: rbescos
Subject: Last 2 months to current date
Date Posted: 12 Jan 2011 at 11:53am
How can I take this back to include the last 2 months instead of current month to date?
 

month({BM_LO.Est Closing Dt}) = month(currentdate) and

year({BM_LO.Est Closing Dt}) =year(currentdate)

Thank you in advance.



Replies:
Posted By: DBlank
Date Posted: 13 Jan 2011 at 4:07am
depends on if you want the first of the month or two months from today
 
2 months from today
{BM_LO.Est Closing Dt} in dateadd('m',-2,currentdate) to currentdate
 
2 months from the first of the month
{BM_LO.Est Closing Dt} in dateserial(year(currentdate),month(currentdate)-2,1) to currentdate



Print Page | Close Window