[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: Multiple parameter for WHERE clause



or you could use a dynamic where clause to be a little more efficient:

let $q = chr(39)    !single quote
if RUN_CNTL.bus_unit = ' ' or RUN_CNTL.bus_unit = ''
   let $where = ''
else
   let $where = 'WHERE BUSINESS_UNIT = ' || $q || RUN_CNTL.bus_unit || $q
end-if

Begin-SELECT

BUSINESS_UNIT

  FROM PS_TABLE
[$where]

End-SELECT

HTH,
Peter

>>> Chantelle Wall <cwall@MAIL.RATH.PEACHNET.EDU> 2001/01/10 8:39:30 am >>>
If your panel is running an SQR use something like this:

let $unit = RUN_CNTL.business_unit

if $unit = ' ' or $unit = ''
   let $unit = '%'
else
   let $unit = RUN_CNTL.business_unit
end-if

Begin-SELECT

BUSINESS_UNIT

  FROM PS_TABLE
WHERE BUSINESS_UNIT like $unit

End-SELECT

If your panel is running a Crystal report you can use People Code behind
the field to set the value to the wild card '%'.