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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 ISNULL function problem

Author  Topic 

wleonard
Starting Member

30 Posts

Posted - 2011-04-12 : 17:49:38
SELECT rtrim(tblinventoryonhand.inp_short_item_number)+rtrim(Isnull(tblinventoryonhand.isc_color, ''))+rtrim(Isnull(tblinventoryonhand.isc_size, ''))
FROM tblinventoryonhand
INNER JOIN cat_prod
ON tblinventoryonhand.inp_short_item_number=cat_prod.ProdCode

Error message:


Msg 207, Level 16, State 1, Line 1
Invalid column name 'isc_color'.
Msg 207, Level 16, State 1, Line 1
Invalid column name 'isc_size'.

Can someone tell me why it does not recognize the column name?

Cheers.

Will Leonard

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-04-12 : 17:54:49
Do you see them listed here?:

select COLUMN_NAME
from INFORMATION_SCHEMA.COLUMNS
where TABLE_NAME = 'tblinventoryonhand'
order by ORDINAL_POSITION

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -