Did you have table named Category in current database?
>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
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.