Click here to Skip to main content
15,881,204 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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..
Posted
Comments
[no name] 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

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.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900