简体   繁体   English

操作数类型clash int与sql server中的日期不兼容

[英]operand type clash int is incompatible with date in sql server

CREATE TABLE EMPLOYEE2 
(
EMPLOYEEID INT PRIMARY KEY IDENTITY(1,1),
FIRSTNAME VARCHAR(50)NULL,
LASTNAME VARCHAR(50)NULL,
SALARY bigint NOT NULL,
JOININGDATE DATE NOT NULL,
DEPARTMENTNAME VARCHAR(50)
)

This is the table I have created. 这是我创建的表。 And I now want to insert the values given below. 我现在想插入下面​​给出的值。

INSERT INTO EMPLOYEE2 (FIRSTNAME,LASTNAME,SALARY,JOININGDATE,DEPARTMENTNAME)
VALUES('JOHN','ABRAHAM',1000000,2013-01-01,'BANKING'),
('MICHAEL','CLERK',800000,2013-01-01,'INSURENCE'),
('ROY','THOMOS',700000,2013-01-01,'BANKING'),
('TOM','JOSE',600000,2013-02-01,'INSURENCE'),
('JERRY','PINTO',650000,2013-02-01,'INSURENCE'),
('PHILIP','MATHEW',750000,2013-01-01,'SERVICES'),
('TESTNAME1','123',650000,2013-01-01,'SERVICES'),
('JOHN','COOK',600000,2013-02-01,'INSURENCE');

But now I am getting an error like: 但现在我收到的错误如下:

Operand type clash: int is incompatible with date 操作数类型冲突:int与日期不兼容

Put quotes around your date. 在你的约会日期附近加上报价。 ie '2013-01-01' not 2013-01-01. 即'2013-01-01'不是2013-01-01。 It's treating them like integers and subtracting one from 2013 twice... 它将它们视为整数并从2013年减去一次......

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

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