I have an XML colmn which looks like:
<abc>
<abcdate>2007-01-31T13:47:27.25-05:00</abcdate>
</abc>
The following query :
SELECT xmlColumn.value('(/abc/abcDate)[1]', 'nvarchar(30)') FROM abcTABLE
Returns 2007-01-31T13:47:27.25-05:00
---------
SELECT CAST(xmlColumn.value('(/abc/abcDate)[1]', 'nvarchar(30)') AS DATETIME) FROM abcTABLE
Returns
Msg 241, Level 16, State 1, Line 1
Conversion failed when converting datetime from character string.
-----------------
SELECT CAST(xmlColumn.value('(/abc/abcDate)[1]', 'nvarchar(19)') AS DATETIME) FROM abcTABLE
Returns 2007-01-31 13:47:27.000
because length of 19 trims the milliseconds
------------------
Is it possible to convert this type of XML data type and still acheive accuracy to the milliseconds?
Thanks
Gary