tags:

views:

22

answers:

1

Hello All,

I am trying to create a view as following in SQL Server 2000

CREATE VIEW [dbo].[AC_VW0901]
AS
SELECT 
CASE T2.ItmsGrpCod  
    WHEN 102 THEN T2.ItmsGrpCod
    WHEN 103 THEN T2.ItmsGrpCod
    WHEN 107 THEN T2.ItmsGrpCod
    WHEN 108 THEN T2.ItmsGrpCod
    ELSE 100 
    END AS ItmsGrpCod, 
CASE
    WHEN Month(T0.TaxDate) >=4 AND Month(T0.TaxDate) <= 12 THEN Month(T0.TaxDate) - 3
    WHEN Month(T0.TaxDate) >=1 AND Month(T0.TaxDate) <= 3  THEN Month(T0.TaxDate) + 9
    END As MonthNum,    
CASE
    WHEN Month(T0.TaxDate) >=4 AND Month(T0.TaxDate) <= 12 THEN Year(T0.TaxDate)
    WHEN Month(T0.TaxDate) >=1 AND Month(T0.TaxDate) <= 3  THEN Year(T0.TaxDate) - 1
    END As YearNum, 
T1.Quantity, T1.LineTotal, T4.U_Username, Month(T0.TaxDate) As [Month], Year(T0.TaxDate) As [Year], T0.TaxDate
FROM OINV T0
INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry
INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode
INNER JOIN OCRD T3 ON T0.CardCode = T3.CardCode
INNER JOIN OSLP T4 ON T3.SlpCode = T4.SlpCode

This throws an error as following

Msg 208, Level 16, State 1, Server N4IDEL130007, Procedure AC_VW0901, Line 26 Invalid object name 'OSLP'.

The table OSLP is very much there. I can use it another view, perform select query on it. What could be the reasons?

Regards, Rahul Jain

+1  A: 

Sorry, the problem was resolved by using full name like Abc.dbo.OSLP Thanks.

Rahul Jain