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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting a relative default parameter date?

Status
Not open for further replies.

DKupper

Technical User
Aug 6, 2009
2
US
Greetings all.

I have a report where I'd like to add relative default parameters, but I don't know if it's possible.

What I'd like:

The report has two parameter fields: Start Date and End Date. Generally, Start Date and End Date will be 7 days apart, and End Date will be the day before it's run. However, it can be run for any length of time and any range.

I'd like the defaults to show up as I described - if I run it on 8/6/09, I'd like Start Date to have 7/30/09 and End Date to have 8/5/09.

From what I can tell, the defaults are only hard coded, there's no logic available without using something like VBScript, but I wanted to see if anyone had advice....

Thanks!
 
Hi,
Set Default parameters to some obvious 'sample' values ( like 1/1/1600) and test for them to see if they were changed and act accordingly, something like:

Code:
If ({?Start Date} = DefaultValue  OR {End Date = DefaultValue )
then
{DateField In (CurrentDate - 7) to  (CurrentDate -1)
Else
{DateField} In {?Start Date} to {?End Date}



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top