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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 f0911

Author  Topic 

tariq2
Posting Yak Master

125 Posts

Posted - 2011-07-14 : 07:07:01
I am trying to find all fields of the records within proddta.f0911
where gldoc,gljeln exists witin the subquery.

I am receiving the following error:
Msg 4145, Level 15, State 1, Line 5
An expression of non-boolean type specified in a context where a condition is expected, near ','.


Many thanks in advance for your help


select * from openquery(symprod_etldev,'select * from proddta.f0911
where glco = ''10002'' and globj = ''445791'' ')

where gldoc,gljeln in

(

select a.gldoc,a.gljeln from openquery(symprod_etldev,'select * from proddta.f0911 where glco = ''10002'' and globj = ''445791'' ')a

left outer join

(select GLDOC,GLJELN from F0911 where GLCO = '10002' and GLOBJ = '445791')b

on a.gldoc = b.gldoc and a.gljeln = b.gljeln

where b.GLJELN IS NULL

)

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2011-07-14 : 07:34:39
WHERE ... IN(...) is only possible for one column at a time.
So you need for example:
WHERE x IN(...)
AND y IN(...)


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

tariq2
Posting Yak Master

125 Posts

Posted - 2011-07-14 : 08:36:45
Thank you webfred :)
Go to Top of Page
   

- Advertisement -