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

"OR" Parameter

Status
Not open for further replies.

smmt2207

MIS
Feb 27, 2007
36
US
I am trying to find a formula that would allow me to use one parameter OR another parameter in the same report. For example have two parameters such as Choose Date range "OR" Choose Report number.

Any ideas would be greatly appreciated


Thanks,
Margie
 
Set Defaults for each parameter and code accordingly:

//date set to 1/1/1970 as a default, and the numeric set to -9999 as a default. Then give each a descriptoin, such as Ignore, and turn on the show description only.

Then code the record selection formula as:

(
if {?MyDateParm} <> cdate(1970,1,1) then
{table.date} = {?MyDateParm}
else
if {?MyDateParm} = cdate(1970,1,1) then
true
)
and
(
if {?MyNumericParm} <> -9999 then
{table.numeric} = {?MyNumericParm}
else
if {?MyNumericParm} = -9999 then
true
)

So now they can use one, both or neither.

-k
 
Hi,
Set a default value for each parameter.

Test for it in the record selection criteria
and act accordingly, something like:
Code:
If {?Param1} = Date(1900,01,01)
and
{?Param2} = 'ALL'
[COLOR=green] 
// your default values
[/color]
Then
True
[COLOR=green]
//no parameter was used
[/color]
else
If 
({?Param1} <> Date(1900,01,01)
and
{?Param2} = 'ALL' )
[COLOR=green]
//used Date parameter
[/color]
then
{table.datefield = {?Param1}
else
If 
 ({?Param1} = Date(1900,01,01)
  and
  {?Param2} <> 'ALL'
[COLOR=green]
//used other one
[/color]
{table.stringfield} = {?Param2}
else
If 
 ({?Param1} <> Date(1900,01,01)
  and
  {?Param2} <> 'ALL'
[COLOR=green]
//used BOTH 
[/color]
(
{table.stringfield} = {?Param2}
and
{table.Datefield = {?Param1}
)




[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Hi,
Guess synapse and I are doing the same thing today..( And I am always a little late..)



[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