0
declare variable $mRec := "010155-00";
for $pi in /NTSFP10/dbo_PatRefInfo/ROW
for $pa in /NTSFP10/dbo_Patient/ROW
where $pi/PatientID = $pa/PATID and $pa/PATID = $mRec
return ($pa/PATID)

Nothing is returned, but I have verified the mRec exists in each table. both are nvarchar or varchar Sample data file

Anthony
  • 1
  • 1
  • 3
    You need to show us your data. Otherwise the only thing we can tell you is that your query is wrong, and we don't know why. – Michael Kay May 22 '20 at 17:28
  • I mean, the join looks pretty basic, do you see any issue with the join? – Anthony May 26 '20 at 17:15
  • 1
    There's nothing wrong with your syntax, but for all I can tell without seeing your data, the semantics might be all wrong. For example, about one person a day posts a query (or xpath) on StackOverflow that fails because the elements are in a namespace, and we can only tell if you've fallen into that common trap by seeing the data. – Michael Kay May 27 '20 at 07:51
  • 1
    And I mean actual data, not a screen shot of a small part of it. – Michael Kay May 27 '20 at 07:54

0 Answers0