General information
Forum:
Microsoft SQL Server
Environment versions
SQL Server:
SQL Server 2005
Try qualifying category with dbo.category or whatever you have set up as the database owner.
>This is my first time using case statement; I am tried to case the value of a field on a select statement as follows:
>
>SELECT #f.catcode,
> #f.subcode,
> '' AS sercode,
> '' AS ITEMNO,
> CASE LEN(#f.SubCode)
> WHEN 0 THEN #f.CatCode
> ELSE #f.CatCode + #f.SubCode
> END AS ITEM_NO,
> CASE LEN(#f.SubCode)
> WHEN 0 THEN ''
> ELSE #f.SubCode
> END AS FATHER,
> CASE LEN(#f.SubCode)
> WHEN 0 THEN category.catdesc
> ELSE category.catdesc
> END AS ITEMDESC,
> '' AS UNIT,
> 0 AS PIECES,
> 0 AS qoh,
> 0 as lastone
> into #cur1
>FROM #f inner join category on #f.catcode = category.catcode or #f.subcode = category.subcode
>
>I have an error message as follows:
>Invalid object name 'category'.
>
>Can anyone help me with this?
>
>Best Regards
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only