Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select with Case
Message
 
To
08/10/2007 15:25:19
Issam Mansour
Jordan Business Machines
Amman, Jordan
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01259547
Message ID:
01259555
Views:
15
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform