简体   繁体   English

SQL 服务器错误操作数类型冲突:int 与日期不兼容

[英]SQL Server error Operand type clash: int is incompatible with date

I am inserting values into my table and I'm stuck in a Date datatype problem.我正在向我的表中插入值,但我陷入了Date数据类型问题。 Does anyone know how to fix this?有谁知道如何解决这一问题?

create table filme
(
    cod_filme int primary key,
    titulo varchar (20),
    ano int,
    time int,
    idioma varchar (20),
    data_lancamento date,
    país_lancamento varchar (20)
);

insert into filme values
         (902, 'The Innocents', 1961, 100, 'English', '1962-02-19', 'SW'),
         (903, 'Lawrence of Arabia', 1962, 216, 'English', '1962-12-11', 'UK'),
         (904, 'The Deer Hunter', 1978, 183, 'English', '1979-03-08', 'UK'),
         (905, 'Amadeus', 1984, 160, 'English', '1985-01-07', 'UK'),
         (906, 'Blade Runner', 1982, 117, 'English', '1982-09-09', 'UK'),
         (907, 'Eyes Wide Shut', 1999, 159, 'English', NULL,'UK'),
         (908, 'The Usual Suspects', 1995, 106, 'English', '1995-08-25', 'UK'),
         (909, 'Chinatown', 1974, 130, 'English', '1974-08-09', 'UK'),
         (910, 'Boogie Nights', 1997, 155, 'English', '1998-02-16', 'UK'),
         (911, 'Annie Hall', 1977, 93, 'English', '1977-04-20', 'USA'),
         (912, 'Princess Mononoke', 1977, 134, 'Japanese', '2001-10-19', 'UK'),
         (913, 'The Shawshank Redemption', 1994, 142, 'English', '1995-02-17', 'UK'),
         (914, 'American Beauty', 1999, 122, 'English', NULL,'UK')

Some internationalization settings can affect the interpretation of dates in the YYYY-MM-DD format.某些国际化设置可能会影响 YYYY-MM-DD 格式的日期解释。

The format without hyphens, YYYYMMDD, always works.没有连字符的格式 YYYYMMDD 始终有效。 So you can try, say, '19950217' instead of '1995-02-17' .因此,您可以尝试'19950217'而不是'1995-02-17'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 SQL 服务器“操作数类型冲突:int 与日期不兼容”错误 - SQL Server 'Operand type clash: int is incompatible with date' error 操作数类型clash int与sql server中的日期不兼容 - operand type clash int is incompatible with date in sql server SQL Server 2012(触发器)操作数类型冲突:int与日期不兼容 - SQL Server 2012 (triggers) Operand type clash: int is incompatible with date SQL Server Operand类型冲突:日期与int不兼容 - Sql Server Operand type clash: date is incompatible with int SQL错误IS操作数类型冲突:int与日期不兼容 - SQL ERROR IS Operand type clash: int is incompatible with date 操作数类型冲突:日期与sql server中的smallint错误不兼容 - Operand type clash: date is incompatible with smallint error in sql server SQL语句不起作用 - “操作数类型冲突:日期与int不兼容” - SQL statement not working - "Operand type clash: date is incompatible with int' 如何修复错误 - 操作数类型冲突:日期与 int 不兼容 - How to fix the error - Operand type clash: date is incompatible with int 操作数类型冲突:日期与int不兼容? - Operand type clash: date is incompatible with int? 使用日期“'操作数类型冲突:日期与int不兼容'用SQL查询填充Datagrid - Fill Datagrid with Sql Query using Date " 'Operand type clash: date is incompatible with int''
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM