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

Overriding Parameters

Status
Not open for further replies.

nixy2000

Programmer
Dec 11, 2003
5
GB
I have two parameters and want to override the first based on the value of the second.

i.e. Something like

if {?Use Current Date} then
{?Running Date} := CurrentDateTime

Anyone know how/where I can do this as I am having problems getting it to run
 
Hmm, more information would have been useful here, but here goes :

if {?Use Current Date} then
{?Running Date} := CurrentDateTime

1. You are not checking {?Use Current Date} for a value. Something like :

if {?Use Current Date}= "Yes" then

2. You are trying to set the value of a parameter as if it were a variable :

{?Running Date} := CurrentDateTime

3. Try letting us know EXACTLY what it is you're trying to do, you'll find people here are very helpful, but this does make things difficult....

Reebo
UK
 
Apologies, New to this so here goes.

I have a report that contains approx 9 subreports, each of which is passed a date parameter {?Running Date}.

When the report was initially specified there was no indication given that this was not satisfactory. However now we want to set up a schedule and we want it to always run for todays date. Unfortunately at the moment if you set up a schedule then it will always run for the specified date and not todays date.

What I wanted to do was a another parameter, something like {?Use Current Date} which if checked would override the value of the {?Running Date} parameter before it is passed into the subreports.

I could change the subreports to take this extra argument and deal with the situation at the sp level (SQL) but I wondered if there was a quicker way.

My other thought was could I use a formula and then pass this in as the argument to the subreport but this didnt seem to be possible.

Any Further Assistance would be very gratefully received

John
 
Ok, you need to join the subreports via a formula field rather than a parameter. This will work out whether you are running for todays date or not...

Setup a boolean parameter called {?Use Current Date} then create the formula :

{@JoinFormula}
If {?Use Current Date} = true then CurrentDate else
{?Running Date}

Let me know how you get on ....


Reebo
UK
 
That worked a treat,

Had a minor issue with the linking but it worked in the end

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top