Print Page | Close Window

Parameter based on current date

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=5298
Printed Date: 28 Apr 2024 at 11:44pm


Topic: Parameter based on current date
Posted By: Novar
Subject: Parameter based on current date
Date Posted: 22 Jan 2009 at 11:29am
This should be so simple, but I've racked my brain to no avail...  I run a report based on two criteria. Basically show me records where both exist.  <field A> < "CurrentDate -7" AND <field B> > "CurrentDate-14".  When the user opens the report the report should update based on Today's Date.  Am I asking too much of CR??



Replies:
Posted By: DBlank
Date Posted: 22 Jan 2009 at 12:06pm
Not sure if you are doing =, < or > but Try:
{table.fieldA}=dateadd("d",-7,currentdate) and {table.fieldB}=dateadd("d",-14,currentdate)
 
and switch the = for whatever you were trying to match.


Posted By: Novar
Date Posted: 22 Jan 2009 at 2:25pm

Works perfect.  Thanks a ton!




Print Page | Close Window