解决方案: |
对于该问题(无数据提供),可通过sql跟踪分析: 参照时,后台sql语句如下(可通过sql事件跟踪器进行捕获)-》 select .查询字段列 ... from (数据源) as a 其中数据源如下-》 select * , ltrim(str(cast(ISNULL(iQuantity,0)-isnull(fStopQuantity,0) +ISNULL(fInQuantity,0) - ISNULL(fOutQuantity,0) as decimal(20,2)),20, 2)) as iCanQuantity , ltrim(str(cast(ISNULL(iNum,0)-isnull(fStopNum,0) + ISNULL(fInNum,0) - ISNULL(fOutNum,0) as decimal(20,2)),20,2)) as iCanNum ,ltrim(str(cast( iquantity as decimal(20,2)),20, 2)) as RealyiQuantity , ltrim(str(cast(inum as decimal(20,2)),20,2)) as Realyinum from SA_myCurrentStockRef where cwhcode='仓库编码' and ( 1=1 and isnull(dEDate,'9999-12-31')>'登录日期') AND bsale=1 and isnull(bStopFlag,0)=0 AND ISNULL(bGspStop,0)=0 and ((isnull(cbatch,'')='' ) or (isnull(cbatch,'')<>'' )) 可根据当前出现问题的仓库信息、存货编码信息,结合后台sql查询语句,在sql查询分析器中进行分析查询; 如无法查询显示1221016存货,可不加任何条件直接打开视图SA_myCurrentStockRef,查看是否有1221016记录;如有则继续分解上一步中的where查询条件,如无则进行下一步,对视图SA_myCurrentStockRef进行分析查询: 可在sql企业管理器或查询分析器中【编辑】视图SA_myCurrentStockRef,查看视图构成, ALTER view SA_myCurrentStockRef as select...字段查询列... from currentstock inner join inventory on currentstock.cinvcode=inventory.cinvcode inner join warehouse on currentstock.cwhcode=warehouse.cwhcode left join ComputationUnit ComputationUnit1 on inventory.cComunitCode=ComputationUnit1.cComunitCode left join ComputationUnit ComputationUnit2 on inventory.cSAComUnitCode=ComputationUnit2.cComunitCode left join Vendor on Inventory.cVenCode=Vendor.cVenCode 首先currentstock表中应是有该存货记录的,级联多表时无记录则应是与某个表关联条件记录不存在,导致级联后查询无记录。需要对上列查询过程分解后查询分析,从而定位问题所在。 |