Conversion failed when converting date and/or time from character string while inserting datetime

后端 未结 15 1508
隐瞒了意图╮
隐瞒了意图╮ 2020-11-22 09:34

I was trying to create a table as follows,

create table table1(date1 datetime,date2 datetime);

First I tried inserting values as below,

15条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-22 09:54

    For me this worked:

    INSERT INTO [MyTable]
               ([ValidFrom]
               ,[ValidTo])
           VALUES
               ('2020-01-27 14:54:11.000'
               ,'2023-01-27 14:52:50.000')
    

提交回复
热议问题