[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



I have an SQR report that is similar
This is how I handle multiple parameters:

Begin-Procedure Get-Input
! -----------------------------
Input $_CLNT_ID_N 'Enter a value for CLNT_ID_N' MaxLen=15  Type=Number
If IsNull($_CLNT_ID_N) or IsBlank($_CLNT_ID_N)
  Let $_CLNT_ID_N = '5838'
End-If
 Let $where_clause1 = $_CLNT_ID_N

Input  $_PLAN_NUM 'Enter a value for PLAN' MaxLen=20  Type=Text
If IsNull($_PLAN_NUM) or IsBlank($_PLAN_NUM)
  Let $_PLAN_NUM = '(' || '''001''' || ',' || '''002''' || ',' || '''003'''
|| ',' || '''004''' || ')'
Else
  let $_PLAN_NUM = '(' || '''' || $_PLAN_NUM || '''' || ')'
End-If
 Let $where_clause2 = $_PLAN_NUM

End-Procedure


Begin Procedure Main

Begin-Select
....
from .....
where clnt_id_n = [$where_clause1]
and db_plan_n IN [$where_clause2]


Kathy

> -----Original Message-----
> From: Anne Mongauzy [SMTP:amongauzy@GVJONES.COM.AU]
> Sent: Tuesday, January 09, 2001 11:44 PM
> To:   SQR-USERS@list.iex.net
> Subject:      Multiple parameter for WHERE clause
>
> Hi
>
>    I have a PeopleSoft report which can have multiple parameter that can
> either be used or not depending on the users preference.
> ie: If a benefit plan is entered use the code specified else use all
> benefit
> plan. I have around 6 different options like this.
>
> I am wondering what would be the most efficient way to code this type of
> specification??
>
> Thanks