title: Query till Where clause runs fine if i add AND condition in one of the joins
body: <p>I am facing below error with <code>where</code> clause after I am using <code>AND</code> condition in join:</p>
  
  <blockquote>
    <p>OLE DB provider "OraOLEDB.Oracle" for linked server "xyz" returned
    message "ORA-01403: no data found". Msg 7346, Level 16, State 2, Line
    1 Cannot get the data of the row from the OLE DB provider
    "OraOLEDB.Oracle" for linked server "xyz".</p>
  </blockquote>
  
  <p>Below query is working fine :</p>
  
  <pre><code>SELECT DISTINCT a.FileNumber, a.FileSub, a.CurrentBatchRecordID, b.BatchName, b.BatchID,b.BatchStatusID,
   b.CreateDate, b.IOGCBatch,e.Area,e.LandDistrict,f.province,f.name
   FROM Lease.tFileSubReviewers AS a
    LEFT OUTER JOIN Lease.tBatchHeader AS b ON b.RecordID = a.CurrentBatchRecordID
    LEFT OUTER JOIN Admin.tUser AS c 
    ON c.RecordID = a.ReviewerID    
   LEFT OUTER JOIN Lease.tFileSubDetail as e on a.FileNumber=e.FileNumber 
      LEFT OUTER join  openquery("xyz",
   'SELECT Code ,RTRIM(PROVINCE) AS PROVINCE,RTRIM(NAME) AS NAME FROM CSL_T_AREA order by province') as f 
   on f.code=e.Area where a.ReviewerID=179 
  </code></pre>
  
  <p>But if I add an <code>AND</code> condition to join prior to the openquery join as below:</p>
  
  <pre><code> SELECT DISTINCT a.FileNumber, a.FileSub, a.CurrentBatchRecordID, b.BatchName, b.BatchID,b.BatchStatusID,
   b.CreateDate, b.IOGCBatch,e.Area,e.LandDistrict,f.province,f.name
   FROM Lease.tFileSubReviewers AS a
    LEFT OUTER JOIN Lease.tBatchHeader AS b ON b.RecordID = a.CurrentBatchRecordID
    LEFT OUTER JOIN Admin.tUser AS c 
    ON c.RecordID = a.ReviewerID 
  
   LEFT OUTER JOIN Lease.tFileSubDetail as e on a.FileNumber=e.FileNumber **and a.FileSub =e.FileSub**  
    LEFT OUTER join  openquery("xyz",
   'SELECT Code ,RTRIM(PROVINCE) AS PROVINCE,RTRIM(NAME) AS NAME FROM CSL_T_AREA order by province') as f 
   on f.code=e.Area where a.ReviewerID=179  
  </code></pre>
  
  <p>I get an error as shown at the top. Even if i do not include <code>where</code> condition at the end in 2nd query, query runs fine.</p>
  
  <p>Can anyone help me with this?</p>
  
  <p>Thanks.</p>