解决方案: |
use ufdata_001_2007
go
Select (case cmassunit when 0 then '''' when 1 then ''年'' when 2 then ''月'' when 3 then ''日'' else null end) as 保质期单位,cBatch as 批号 ,ltrim(Str((iQuantity-IsNull(fTransOutQuantity,0)-IsNull(fStopQuantity,0)),20,2)) as 结存数量,ltrim(Str((iNum-IsNull(fTransOutNum,0)-IsNull(fStopNum,0)),20,2)) as 结存件数,iQuantity as 出库数量, iNum as 出库件数 ,dMDate as 生产日期,iMassDate AS 保质期,dVdate AS 失效日期 From CurrentStock Where cWhcode=''201'' And cInvCode =''090100601'' And IsNull(cBatch,'''')<>'''' And isnull( bstopflag,0)=0 and dVdate is not null
select distinct(cBatch) from currentstock where cWhcode=''201'' And cInvCode =''090100601'' And IsNull(cBatch,'''')<>'''' And isnull( bstopflag,0)=0 and dVdate is not null and cbatch like ''%0704%''
修改 失效日期 13条记录 为空 |