>>select * from openquery(VAMCPD,'select a.cItemno,a.nShipQty,a.nSalesAmt-a.nDiscAmt as Amt >> from aritrs a >> inner join arinvc b on a.cInvNo=b.cInvNo >> where a.cCustno+a.cInvNo like "'+@StringPar+'%" and cType= ""') >>>>this is not tested.
>>select * from openquery(VAMCPD,'select a.cItemno,a.nShipQty,a.nSalesAmt-a.nDiscAmt as Amt >> from aritrs a >> inner join arinvc b on a.cInvNo=b.cInvNo >> where a.cCustno+a.cInvNo like ['+@StringPar+'%] and cType= []') >>Then how about:
select * from openquery(VAMCPD,'select a.cItemno,a.nShipQty,a.nSalesAmt-a.nDiscAmt as Amt from aritrs a inner join arinvc b on a.cInvNo=b.cInvNo WHERE cType= []') test where test.cCustno+test.cInvNo like @StringPar+'%'