SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Other Forums
 MS Access
 Trouble with Query
 New Topic  Reply to Topic
 Printer Friendly
Author  Topic Next Topic  

kravi88
Starting Member

USA
3 Posts

Posted - 06/07/2014 :  19:16:01  Show Profile  Reply with Quote
Hi All,

I'm trying to use Excel as a data source and am making the query using MS Query.
The following query worked using SQL Server Management Studio but is not working for Excel:
-------------------------------------------------------
select e1.name
,e1.role
,r1.duty
,d1.conflict
from emp as e1, [role] as r1, conflict as d1
where
e1.[role]=r1.[role] and
r1.duty=d1.duty
and exists (select 1
from emp as e2, [role] as r2, conflict as d2
where
d2.duty=r2.duty and
r2.[role]=e2.[role] and
e2.name=e1.name
and r2.role<>r1.role
and r2.duty<>r1.duty
and r2.duty=d1.conflict
)
order by e1.name

--------------------------------------------------------

Please advice.

Thanks and regards !
   Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000