Click here to Skip to main content
15,896,269 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
SQL
select distinct t.HICN,t.PatientName,t.PracticeName, t.HCCDescription+ isnull(pp.HCC_Description,'')  as HCCDescription
 from temptbl_CCMData  t left outer join VwLatestPatientDetails vw on vw.hicnumber=t.hicn
  left outer join icdhcc pp on pp.HCC=t.HCCDescription WHERE VW.taxid=593516436
Posted
Updated 19-Nov-15 1:27am
v2

This is because there are null values in the records and you are using it for operations which will create this error.

One way to get rid of this problem is firing the below:

SQL
SET ANSI_WARNINGS OFF
GO
 
Share this answer
 
I think problem is in this line

SQL
t.HCCDescription+ isnull(pp.HCC_Description,'')
for example if second filed is null then you are trying to concatenate the first field with null object, so that it's throwing that error.

I request you to please try below query


SQL
select distinct t.HICN,t.PatientName,t.PracticeName,ISNULL(Convert(varchar(100), t.HCCDescription)+ Convert(varchar(100),pp.HCC_Description))  as HCCDescription
 from temptbl_CCMData  t left outer join VwLatestPatientDetails vw on vw.hicnumber=t.hicn
  left outer join icdhcc pp on pp.HCC=t.HCCDescription WHERE VW.taxid=593516436
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900