I have below code which selects a date value from an XML string in SQL Server. The string value returns format in ddmmyy
and I need to convert this to T-SQL datetime
type before saving it to a table.
SELECT TOP 1
list.n.value('(DOB/@value)[1]', 'datetime') AS 'DOB'
FROM
@ResultXML.nodes('/Variables') AS list(n)
XML file:
<Variables>
<DOB>111290</DOB>
</Variables>