此更新声明有什么问题:?
此更新声明有什么问题:
declare @s1from datetime
UPDATE Table1 SET Product = @Product , fare = @fare, s1from = convert(datetime,convert(datetime,@s1from,103),120)
whats wrong in this update statement :
declare @s1from datetime
UPDATE Table1 SET Product = @Product , fare = @fare, s1from = convert(datetime,convert(datetime,@s1from,103),120)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这个表达式:
Convert(datetime,convert(datetime,GETDATE(),103),120) 工作正常,因此如果出现错误,您可能会忘记设置 @s1from 的值,代码中没有任何行。尝试
DECLARE @s1from datetime
SET @s1from = GETDATE()
SELECT Convert(datetime,convert(datetime,@s1from,103),120)
this expression:
convert(datetime,convert(datetime,GETDATE(),103),120) works fine, so if you get an error you might forget about setting the value of @s1from, there is no line in your code. Try
DECLARE @s1from datetime
SET @s1from = GETDATE()
SELECT convert(datetime,convert(datetime,@s1from,103),120)