i have sub_pk field as int in sup_purchase_master table and code as nvarchar in packing_slip_sub...
In Code Field values are like R100,R11,so on..
I am Using Following Query and i am getting this error Conversion failed when converting the nvarchar value 'R' to data type int...please help
SELECT [Sub_Pk],[Purchase_FK],[Quality],[Design],[Shade] ,[Tot_meter],[Actual_meter],[Damage],[Sample],[Stck_meter],[Rate],[Amount],Type,[Shade_No],[Chart],[Location],[Remarks]
FROM [Sub_purchase_mastr]
where [Purchase_FK] = '757'
and sub_pk not in (Select code from Packing_Slip_Sub where [Del_SFlag] is null and substring(code,1,1)!='R')