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

Popular posts from this blog

php - Magento - Deleted Base url key -

javascript - Tooltipster plugin not firing jquery function when button or any click even occur -

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -