I have seen many questions addressing this issue, but unfortunately I still was not able to make it work.
Here's an example of the XML data contained in an XML column called RentalValueAmount in a table called Units:
<X C="1" I="0">
<E D="1000Y0M0W0D" P="1" A="36500" />
</X>
I tried this but did not get any values:
select
cast(RentalValueAmount as XML).value('data(/X/E)[1]','varchar(10)') as test
from dbo.units
I need to extract or return 36500 as a number using a query but I have not been able to do so. Obviously I do not know XML, so I would really appreciate the help.