>I am doing a local view where I am trying to retrieve a value base on a condition that op_flag_1 must equal 4 and only then all items that have op_flag_3 = 2 or 1. The follow code is generate by my view:
>
>SELECT O_ord_pay.op_uniqueid, O_ord_pay.op_flag_1,;
> O_ord_pay.op_main_key, O_ord_pay.op_ord_date, O_ord_pay.op_desc,;
> O_ord_pay.op_vendor, O_ord_pay.op_division, O_ord_pay.op_programs,;
> O_ord_pay.op_comm, O_ord_pay.op_contact, O_ord_pay.op_chg_date,;
> O_ord_pay.op_modi_by, O_ord_pay.op_probno, O_ord_pay.op_est_date,;
> O_ord_pay.op_rec_date, O_ord_pay.op_est_amt, O_ord_pay.op_amt,;
> O_ord_pay.op_date_paid, O_ord_pay.op_checkno, O_ord_pay.op_invoice,;
> O_ord_pay.op_reimburse, O_ord_pay.op_flag_3;
> FROM dbbudget!o_ord_pay;
> WHERE O_ord_pay.op_flag_1 = 4;
> AND O_ord_pay.op_flag_3 = ?lc_flg3a;
> OR (O_ord_pay.op_flag_3 = ?lc_flg3b);
> ORDER BY O_ord_pay.op_ord_date
>
>I am using a filter tab that look like following:
>
>O_ord_pay.op_flag_1 = 4 AND
>O_ord_pay.op_flag_3 = ?lc_flg3a OR && this will contain value 1
>O_ord_pay.op_flag_3 = ?lc_flg3b && this will contain value 2
>
>What I am trying to doing is arrange this filter tab to my where condition looks like the following: (notice how my parenthesis should probably be)
>
>WHERE O_ord_pay.op_flag_1 = 4;
> AND (O_ord_pay.op_flag_3 = ?lc_flg3a;
> OR O_ord_pay.op_flag_3 = ?lc_flg3b);
> ORDER BY O_ord_pay.op_ord_date
>
>I am trying to look for flag_1 matching 4 and then flag_3 equaling 1 or 2.
>Currently my view is finding all 4's and also everything that has 1 and 2. I only need flag_3 value that equal 1 and 2 for flag_1 that has value 4. Help appreciated
>
>Nick
Nick,
Should'nt it be this way?
WHERE O_ord_pay.op_flag_1 = 4 AND INLIST( O_ord_pay.op_flag_3, 1, 2)
José