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 table have created. , want insert values given below.
insert 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 getting error like:
operand type clash: int incompatible date
put quotes around date. i.e. '2013-01-01' not 2013-01-01. it's treating them integers , subtracting 1 2013 twice...
Comments
Post a Comment