Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
wendy
Starting Member
19 Posts |
Posted - 2006-04-13 : 16:14:04
|
| Hi,After I changed the “P.bu_id = CASE WHEN O.bu_id = '1-2Y3' OR O.bu_id = '1-2XR' THEN '1-TKA1N' ELSE O.bu_id END” To “CASE WHEN O.bu_id = '1-2Y3' OR O.bu_id = '1-2XR' THEN P.bu_id in ('1-TKA1N','1-72LTOE') ELSE P.bu_id = O.bu_id END” at the following query, I got invalid table error. Any one has the idea about what’s wrong, any help will be appreciated..Select C.row_id as contact, T.row_id as ID, T.name as Territoryfrom Siebel.s_contact C, Siebel.s_org_ext O, Siebel.s_asgn_grp Twhere C.pr_dept_ou_id = O.row_idand C.row_id in (Select par_row_id from Siebel.s_contact_xmwhere name = 'Course.com'and type = 'IA'and attrib_46 = 'Active')and (C.csn is NULL or C.csn = 'Active')and O.par_ou_id is NULLand T.pr_postn_id in(Select row_id from Siebel.s_postn Pwhere row_id in(Select position_id from Siebel.s_accnt_postnwhere ou_ext_id = O.row_id)and CASE WHEN O.bu_id = '1-2Y3' OR O.bu_id = '1-2XR' THEN P.bu_id in ('1-TKA1N','1-72LTOE') ELSE P.bu_id = O.bu_id ENDand P.bu_id <> P.ou_id)ThanksWendy |
|
|
Srinika
Master Smack Fu Yak Hacker
1378 Posts |
Posted - 2006-04-13 : 16:18:07
|
| If u can tell us what u want to do by the following :... THEN P.bu_id in ('1-TKA1N','1-72LTOE') ....V may be able to helpSrinika |
 |
|
|
wendy
Starting Member
19 Posts |
Posted - 2006-04-13 : 16:25:13
|
| When the O.bu_id = '1-2Y3' OR O.bu_id = '1-2XR', the P.bu_id has to be either '1-TKA1N' or '1-72LTOE'. ThanksWendy |
 |
|
|
Srinika
Master Smack Fu Yak Hacker
1378 Posts |
Posted - 2006-04-13 : 16:40:55
|
| In a computer language there should not be any ambiguityU have to tell specifically when it has to be '1-TKA1N' and when it has to be '1-72LTOE'Computer just won't select it randomlyor if u want to assign those values depending on the value of O.bu_id being '1-2Y3' OR '1-2XR', then u have to use 2 When statementsSrinika |
 |
|
|
|
|
|
|
|