Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
hi,I need to convert a date with that format "1990-01-01T00:00:00.0000000+01:00" to that format "19/01/2005 9:10:00" ?how can I do it ? I tried CAST('1990-01-01T00:00:00.0000000+01:00' as smalldatetime) but it doesn't work.The error I got is : Syntax error converting character string to smalldatetime data type.Help me please,Kab
spirit1
Cybernetic Yak Master
11752 Posts
Posted - 2006-01-03 : 05:57:07
select dateadd(hour, 1, CAST('1990-01-01T00:00:00' as smalldatetime))get rid of '.0000000' there's no need for that.Go with the flow & have fun! Else fight the flow
shallu1_gupta
Constraint Violating Yak Guru
394 Posts
Posted - 2006-01-03 : 05:59:36
because u are trying to convert a value which is not a valid datetime value.