Click here to Skip to main content
14,424,458 members
Rate this:
Please Sign up or sign in to vote.
See more:
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 ;

return ERROR:
Invalid object name 'dbo.Issue_book'.

please help me..
Abhinaw Kumar 12-Feb-15 1:04am
If this is a typo, most likely, table is never created on selected database.
Jeet Gupta 12-Feb-15 2:12am
the specified error shows that your table is not present or it can have a spelling mistake. try to remove the dbo. if still problem exits check your table name.
Kornfeld Eliyahu Peter 12-Feb-15 2:14am
It also can be that the table Issue_book exists but in different schema - not dbo...
Ganesh KP 12-Feb-15 4:15am
Make sure that you are executing the query on the specified database where that table exists. Also try by removing 'dbo'.
Shridhar Gowda 12-Feb-15 23:01pm
First check select * from dbo.Issue_book ; then use functions u want

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

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.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100