对数据类型而言运算符无效。运算符为 boolean AND,类型为 varchar。
下面是我的代码,估计是第六行有错误,却不知道怎么样进行修改t6.fname & '调入' & t4.fname & '调出' 调入仓库, 这一行代码中的t6.fname 或者t4.fname 都有为null的可能性。
select
t1.fbillno 单号,
t1.fdate 审核日期,
isnull(isnull(t13.fname,t12.fname),t14.fname) 客户_供应商,
isnull(t6.fname,t4.fname) 仓库,
t6.fname & '调入' & t4.fname & '调出' 调入仓库,
t4.fname 调出仓库,
t3.fnumber 料号,
T2.fqty 数量,
t5.fbillname
from icstockbill t1
left join icstockbillentry t2 on t1.finterid =t2.finterid
left join t_icitem t3 on t2.fitemid =t3.fitemid
left join t_stock t4 on t2.FSCStockID=t4.fitemid
left join t_stock t6 on t2.fdcstockid =t6.fitemid
left join ICBillNo t5 on t1.ftrantype =t5.fbillid
left join t_Supplier t13 on t1.FSupplyID = t13.FItemID
left join t_Organization t12 on t1.FSupplyID = t12.FItemID
left join t_Department t14 on t1.fdeptid =t14.fitemid
where t1.fdate between '2014-3-1' and '2014-3-31'
--and t5.fbillname like'仓库调拨单据'
--and year(t1.fdate)=2014 and month(t1.fdate)=4
--and t3.fnumber ='01.11.001940'
order by t1.fdate