SQLTeam.com | Weblogs | Forums

Convert string to datetime OPENXML WITH


#1

Hi,

I am importing data from xml. I receive a string that needs to be converted to datetime. How do i implement it? If i write as below it throws an error that it can't convert varchar to datetime.
I need to add convert and not sure of where.
OPENXML(@hDoc, '/ROOT/Funds')
WITH
(
[insertion_date] [datetime] 'insertion_date',

Thanks


#2

You should go this one, it may be helpful to you. https://phe1129.wordpress.com/2007/03/16/convert-xml-datetime-xsdatetime-to-sql-datetime/