Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
skriver
Starting Member
11 Posts |
Posted - 2012-04-26 : 15:21:37
|
| HiTrying to execute this commandselect os.OrderedProductSKU, convert(DECIMAL(15,2),SUM(os.OrderedProductPrice)) totalsales from Orders_ShoppingCart osjoin Orders o on o.OrderNumber = os.OrderNumberwhere o.OrderDate between '01-Jan-2011' and '01-Jan-2012'group by os.OrderedProductSKU order by 2 descbut I get this errorMsg 208, Level 16, State 1, Line 1Invalid object name 'Orders_ShoppingCart'.That is the correct name of the SQL table. Any ideas where its going wrong? |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-04-26 : 15:23:35
|
| Are you executing it in correct database?Add USE [yourdbname]GObefore the select statement and try executing the batch again------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
skriver
Starting Member
11 Posts |
Posted - 2012-04-26 : 15:28:33
|
| Perfect! |
 |
|
|
|
|
|