Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQLOLEDB Subquery not working properly

Status
Not open for further replies.

AndyHopper

Programmer
Jul 13, 2002
23
US
Here's my table structure;

idxmls1 - the data on the remote server
------
id
etc....

ToDownload - a list of id numbers I need to download
----------
MLS


Here's the query I'm trying to execute to generate the data from the remote server. The query executes without any problems, however neither WHERE clause seems to be executed. All rows from idxmls1 are returned.

SELECT idxmls1.*
FROM idxmls1 WHERE mod_date_time > (SELECT matchDate FROM OPENROWSET('SQLOLEDB','sql.myhost.com';'uid';'pwd',
'SELECT matchDate FROM amIDX.amSql.MatchDate')) OR [id] IN (SELECT ToDownload.MLS FROM OPENROWSET('SQLOLEDB','sql.myhost.com';'uid';'pwd',
'SELECT MLS FROM amIDX.amSql.ToDownload') as ToDownload)

I'm not sure why this isn't working? Each subquery returns the appropriate result when executed independently.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top