[英]Error of Implicit conversion from data type datetime to int is not allowed. Use the CONVERT function to run this query
I have table of stock with DOCDate field and it has datatype as datetime, when i am running my query, it shows me error 我有带有DOCDate字段的库存表,并且数据类型为datetime,当我运行查询时,它向我显示错误
'Implicit conversion from data type datetime to int is not allowed.
'不允许从数据类型datetime到int的隐式转换。 Use the CONVERT function to run this query.'
使用CONVERT函数运行此查询。”
My query is 我的查询是
insert into SSPERPStock (LinkID, DocNo, DocDate, VoucherType, ProductID, Weight, AL, InEdit, CreatedUserId)
values (IDENT_CURRENT('SSPERPDailyInkConsumptionTransaction'),'DOC1001','2013-02-14','ICPacked',8,5,'L',0,GETDATE())
What can be the solution of this mistry?? 这个迷茫的解决办法是什么?
You are trying to add a date ( GETDATE()
) to your column CreatedUserId
您正在尝试将日期(
GETDATE()
)添加到列CreatedUserId
insert into SSPERPStock (... , CreatedUserId)
values (... , GETDATE())
which is probably an int
and not what you wanted to do in the first place. 这可能是一个
int
而不是您最初想要做的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.