How to set datetime variable in SQL Server 2008 -
declare @test datetime set @test='21/03/2014' print @test select @test set @test=21/03/2014 print @test select @test set @test=21-03-2014 print @test select @test set @test=03/21/2014 print @test select @test set @test=2014/21/03 print @test select @test set @test=2014/03/21 print @test select @test
this code gives wrong output plz tell me code assign datetime variable in sqlserver 2008
declare @test datetime set @test='03/21/2014' //set @test='21/03/2014' not valid must give date in mm/dd/yyyy print @test set @test='2014/03/21' print @test
Comments
Post a Comment