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!

Passing parameters .....

Status
Not open for further replies.

sunsree

Programmer
Jul 22, 2002
8
US
Hi!

I am trying to pass parameters to the where clause when i initially create it, it is shown in the where clause but when i added the parameter in the formuls like i want to pass the city name = 'All' and if it accounts All it should fetch all the records no matter what the city name is and it shuld give me "CA" when i pass this parameter instead of all can u please mail me the steps in brief how to create the formula condition which sloved my problem.........
 
If you want a parameter which gets 'All' or a specific value, try something like this:

(
If {?CityParm} <> 'ALL'
and
{?CityParm} <> '' // Also check if they leave it empty
then
{MyTable.MyCity} = {?CityParm}
else
if
{?CityParm} = 'All'
or
{?CityParm} = ''
then
true
)

Note the overkill here in qualifying the parameter and the extra parens, this is intentionally done to help assure SQL pass through to the database.

-k kai@informeddatadecisions.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top