Date Range - Previous 7 Days

Printed From: Crystal Reports Book — Forum Name: Technical Questions

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

Edited by GPDJJ - 23 May 2019 at 2:25am
datediff('d',{lwmain.dtrepor},currentdate) in 1 to 8
Thanks! I was able to figure it out using a different method but it worked. I will archive your formula as well for reference.