Quantcast
Channel: SQLServerCentral » SQL Server 2014 » Development - SQL Server 2014 » Latest topics
Viewing all articles
Browse latest Browse all 3145

Datetime conversion

$
0
0
Hi,I have simple query, I'm trying to convert a varchar value to datetime format but it throwing below error:The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.here is sample query:declare @test varchar(20)set @test ='30/04/2015 23:59:59'select CONVERT(datetime, @test)One interesting observation above query run fines in Sql 2008 but not in Sql 2014Please advice how to fix the errorThanksSam

Viewing all articles
Browse latest Browse all 3145

Trending Articles