[英]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.