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!

Special Selction Criteria

Status
Not open for further replies.
Aug 28, 2003
18
CA
I have a slight problem with selecting data according to a specific criteria. I have created a report with 3 parameter fields. the values to those fields are passed to the report from a web page (using CE 10 Embedded Edition).

Now in each of the 3 fields, I want to be able to select a specific ID number (and filter by this ID) in each field or select all records if the ID = 0.

I have placed the following formula in the selection window:

if {?SalesID} <> 0 then
{Sales.SalesID} = {?SalesID} and
if {?SiteID} <> 0 then
{Sites.SiteID} = {?SiteID} and
if {?Forcast} <> 0 then
{Forcast.ForcastID} = {?Forcast}

Now this works if there are values (other than 0) in all 3 fields. If I try and pass a 0 value in any of the fields, I don't get any data (data does exist also).

Is there some way of placing a filter in the results if the ID <> 0 ?

Anyone have any ideas on how I can get around this?

Any help would be much appreciated.

 
Try:

if {?SalesID} <> 0 then
{Sales.SalesID} = {?SalesID}
else
if {?SalesID} = 0 then
true
)
and
(
if {?SiteID} <> 0 then
{Sites.SiteID} = {?SiteID}
else
if {?SiteID} = 0 then
true
)
and
(
if {?Forcast} <> 0 then
{Forcast.ForcastID} = {?Forcast}
else
if {?Forcast} = 0 then
true
)

-k
 
Almost. Modified to the following:

*******************************************
if {?SalesID} <> 0 then
{Sales.SalesID} = {?SalesID}
else
true

and

if {?SiteID} <> 0 then
{Sites.SiteID} = {?SiteID}
else
true

and

if {?Forcast} <> 0 then
{Forcast.ForcastID} = {?Forcast}
else
true
********************************************

This seems to be working much better.

Thanks for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top