spiff2002
IS-IT--Management
- Jan 31, 2003
- 40
I'm running a query on a MS SQL 2000 server and one of the fields has a lot of NULL values. I'm putting the output into a tab delimited file so the result has to be cleaned up before saving the file.
The following is the Query I'm using but I still cannot get rid of NULL values on the LAST_COST column. Is there a different way to do it???
The following is the Query I'm using but I still cannot get rid of NULL values on the LAST_COST column. Is there a different way to do it???
Code:
select Distinct
itemno,
DESCR ,
cast(bpcase as varchar(5))+'/'+bsize+'- '+measur as SIZE,
cast(PR2_PRICE as numeric)/100 as PRICE,
case LAST_COST
when NULL then ''
else LAST_COST end
as LAST_COST
from dbo.itmprc
inner join itmmas on PR2_ITEMNO=itemno
inner join SLSHST on PR2_ITEMNO=hitmno
inner join cusmas on HCUSNO=cusmas.CUSNO
left join dbo.LAST_COST on ITEM_NUMBER=PR2_ITEMNO