Compare value from xml node that contains decimal I need to compare the values of two different XML nodes for a record stored on SQL Server 2014.

Here is the contents of my XML column that I will be using:

&lt;Document&gt;
   &lt;PolicyId&gt;0&lt;/PolicyId&gt;
   &lt;ChangeAmount&gt;1.4-&lt;/ChangeAmount&gt;
   &lt;PolicyTerm&gt;
       &lt;OutstandingBalance&gt;35.04+&lt;/OutstandingBalance&gt;
   &lt;/PolicyTerm&gt;
   &lt;OriginalCollectionAmount&gt;36.44+&lt;/OriginalCollectionAmount&gt;
&lt;/Document&gt; 


Here is my SQL statement that is not working:

SELECT *
FROM   Table 
WHERE  QueueName ='.\private$\CollectionActivityPosted'
AND    Payload.value('(/Document/TransType)[1]', 'nvarchar(20)') = 'C'
AND    (Payload.value('(/Document/OutstandingBalance)[1]', 'nvarchar(20)') 
       &lt;&gt; 
       (Payload.value('(/Document/OriginalCollectionAmount)[1]', 'nvarchar(20)')))


I am expecting my query to get a hit based on the OutstandingBalance not being equal to the OriginalCollectionAmount but it doesn't.
It looks like you've got the wrong path in your where predicate.  If I do this, it works:

IF OBJECT_ID(N'dbo.x', N'U') IS NOT NULL
DROP TABLE dbo.x;
CREATE TABLE dbo.x
(
    xm xml
);
INSERT INTO dbo.x (xm)
SELECT N'&lt;Document&gt;
   &lt;PolicyId&gt;0&lt;/PolicyId&gt;
  &lt;ChangeAmount&gt;1.4-&lt;/ChangeAmount&gt;
  &lt;PolicyTerm&gt;
    &lt;OutstandingBalance&gt;35.04+&lt;/OutstandingBalance&gt;
  &lt;/PolicyTerm&gt;
  &lt;OriginalCollectionAmount&gt;36.44+&lt;/OriginalCollectionAmount&gt;
&lt;/Document&gt;';

SELECT x.xm.value('(/Document/PolicyTerm/OutstandingBalance)[1]', 'nvarchar(20)')
FROM dbo.x


╔══════════════════╗
║ (No column name) ║
╠══════════════════╣
║ 35.04+           ║
╚══════════════════╝

Testing:    

SELECT *
FROM dbo.x
WHERE (x.xm.value('(/Document/PolicyTerm/OutstandingBalance)[1]', 'nvarchar(20)') &lt;&gt;
     (x.xm.value('(/Document/OriginalCollectionAmount)[1]', 'nvarchar(20)')))


╔═════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗
║                                                                                                       xm                                                                                                        ║
╠═════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╣
║ &lt;Document&gt;&lt;PolicyId&gt;0&lt;/PolicyId&gt;&lt;ChangeAmount&gt;1.4-&lt;/ChangeAmount&gt;&lt;PolicyTerm&gt;&lt;OutstandingBalance&gt;35.04+&lt;/OutstandingBalance&gt;&lt;/PolicyTerm&gt;&lt;OriginalCollectionAmount&gt;36.44+&lt;/OriginalCollectionAmount&gt;&lt;/Document&gt; ║
╚═════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝


In your code, Payload.value('(/Document/OutstandingBalance)[1]', 'nvarchar(20)') should be Payload.value('(/Document/PolicyTerm/OutstandingBalance)[1]', 'nvarchar(20)')