如何计算sql server 2005表中的拖曳列日期 [英] how to calculate tow columns date in sql server 2005 table

查看:106
本文介绍了如何计算sql server 2005表中的拖曳列日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在sql server 2005中计算包含日期时间的拖曳列值。这是我的代码。

I want to calculate tow column value that contain date time in sql server 2005. this is my code.

select DATEDIFF(day,Issue_date,Return_date)as subtract from dbo.Issue_book ;



返回ERROR:


return ERROR:

Invalid object name 'dbo.Issue_book'.



请帮帮我..


please help me..

推荐答案

错误意味着它无法在dbo架构下找到名为Issue_book的表。



首先,不要在表名中使用下划线。如果您可以更改它,请执行此操作。

其次,尝试在表名[Issue_book]周围加上括号。

第三,删除dbo部分。

第四,确保该表位于您连接的数据库中。
The error means it cannot find a table named Issue_book under the dbo schema.

First off, don't use underscores in a table name. If you can change it, do so.
Secondly, try putting brackets around the table name [Issue_book].
Thirdly, remove the dbo part.
Fourth, make sure that table is in the db you are connected to.


这篇关于如何计算sql server 2005表中的拖曳列日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆