Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Replace Data_Range parameter with WeekToDateFromSun

Status
Not open for further replies.

GBreker

Technical User
Oct 27, 2005
1
CA
I am a newbie to CR9. I have some reports that have a Data_Range parameter that is entered when the run it. Date start, date end. How can I change the report to automatically enter the past 7 days (or weektodatefromsun type) as the range.
Thanks in advance
 
{Your.Date} in [Currentdate-7 to currentdate], for the past 7 days.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
It won't default to specific values if that's what you mean.

You can however set permanent default values and if the user doesn't change them it will default to the last week.

The record selection formula->record would then read:

//assuming a default value of 1/1/1970
(
if {Datestart} <> cdate(1970,1,1) then
{table.field} >= {?Startdate}
and
{table.field} <= {?Dateend}
else
if {Datestart} = cdate(1970,1,1) then
{table.field} >= currentdate-6
and
{table.field} <= currentdate)
)

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top