Print Page | Close Window

Date Range - Previous 7 Days

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22778
Printed Date: 30 Apr 2024 at 6:28am


Topic: Date Range - Previous 7 Days
Posted By: GPDJJ
Subject: Date Range - Previous 7 Days
Date Posted: 23 May 2019 at 2:25am
I am looking to create a formula that calculates the previous seven days from midnight to midnight regardless of when I run the report on the eighth day. As of now I use this formula but it runs the previous seven days from the time I run it on the eighth day. I specifically need the the previous seven days from midnight to midnight. Thank you.

datediff('d',{lwmain.dtrepor},currentdate)<8



Replies:
Posted By: DBlank
Date Posted: 23 May 2019 at 7:44am
datediff('d',{lwmain.dtrepor},currentdate) in 1 to 8


Posted By: GPDJJ
Date Posted: 23 May 2019 at 10:24am
Thanks! I was able to figure it out using a different method but it worked. I will archive your formula as well for reference.



Print Page | Close Window