期初库存一步入库 时空软件 的检索方案
luyued 发布于 2011-04-16 09:39 浏览 N 次
120
编号 检索方案 cskc
select a.spid,a.spbh,a.spmch,a.shpgg,a.shpchd,a.dw,a.jlgg,a.jixing,a.shengccj,a.pizhwh,a.zjm,b.shl,
a.shlv,b.hshj/(1+a.shlv/100) as chbdj,b.hshj/(1+a.shlv/100) as jj,hshj as hshjj,a.lshj,hshj as hesj,
isnull(b.pihao,'') as pihao,isnull(b.sxrq,'') as sxrq,
b.hw,b.hwbh,b.huowname
from spkfk a(nolock),太刺激了 b(nolock)
where a.spbh=b.spbh and a.beactive='是'
select a.spbh,a.spmch,a.shpchd,a.shlv ,a.dw,a.shpgg,a.lshj,a.jlgg,c.chbdj as jj,
c.chbdj*(a.shlv/100+1) as hshjj ,
b.shl,b.pihao,b.baozhiqi,b.sxrq,a.spid from spkfk a,sphwph b,hwsp c
where b.hw='HWI00000027' and b.spid=c.spid and b.hw=c.hw
and a.spid=b.spid
1,27 和 28 ,负数退永康
select a.spbh,a.spmch,a.shpchd,a.shlv ,d.huowname,a.dw,a.shpgg,a.lshj,a.jlgg,c.chbdj as jj,
c.chbdj*(a.shlv/100+1) as hshjj ,
-b.shl as shl,b.pihao,b.baozhiqi,b.sxrq,a.spid from spkfk a,sphwph b,hwsp c,huoweizl d
where b.hw='HWI00000028' and b.spid=c.spid and b.hw=c.hw and b.hw=d.hw
and a.spid=b.spid and b.shl<>0
2,导中药库存
select a.spbh,a.spmch,a.shpchd,a.shlv ,d.huowname,a.dw,a.shpgg,a.lshj,a.jlgg,c.chbdj as jj,
c.chbdj*(a.shlv/100+1) as hshjj ,
-b.shl as shl,b.pihao,b.baozhiqi,b.sxrq,a.spid from spkfk a,sphwph b,hwsp c,huoweizl d
where b.hw='HWI00000028' and b.spid=c.spid and b.hw=c.hw and b.hw=d.hw and a.leibie='中药'
and a.spid=b.spid and b.shl<>0
3,导指定药品
select a.spbh,a.spmch,a.shpchd,a.shlv ,d.huowname,a.dw,a.shpgg,a.lshj,a.jlgg,c.chbdj as jj,
c.chbdj*(a.shlv/100+1) as hshjj ,
-b.shl as shl,b.pihao,b.baozhiqi,b.sxrq,a.spid from spkfk a,sphwph b,hwsp c,huoweizl d
where b.hw='HWI00000028' and b.spid=c.spid and b.hw=c.hw and b.hw=d.hw and a.spbh in ('30000','18547')
and a.spid=b.spid and b.shl<>0
4,最终调库正
select a.spbh,a.spmch,a.shpchd,a.shlv,a.dw,'HWI00000124' as hw,'鑫浩药店' as huowname,a.shpgg,a.lshj,a.jlgg,c.chbdj as jj,
c.chbdj*(a.shlv/100+1) as hshjj ,
b.shl,b.pihao,b.baozhiqi,b.sxrq,a.spid from spkfk a,sphwph b,hwsp c,huoweizl d
where b.hw='HWI00000028' and b.spid=c.spid and b.hw=c.hw and b.hw=d.hw and a.leibie<>'中药' and d.beactive='是'
and a.spid=b.spid and b.shl<>0
5,永康减库存
select a.spbh,a.spmch,a.shpchd,a.shlv,a.dw,'HWI00000028' as hw,'永康药店' as huowname,a.shpgg,a.lshj,a.jlgg,c.chbdj as jj,
c.chbdj*(a.shlv/100+1) as hshjj ,
-b.shl as shl,b.pihao,b.baozhiqi,b.sxrq,a.spid from spkfk a,sphwph b,hwsp c,huoweizl d
where b.hw='HWI00000028' and b.spid=c.spid and b.hw=c.hw and b.hw=d.hw and d.beactive='是'
and a.spid=b.spid and b.shl<>0
- 05-20· 证 据 目 录的格式
- 05-14· 发现一个BUG nForce2 的主板
- 05-14· NEC EXPRESSCLUSTER X3.0 FOR WIN
- 05-14· 最近有什么好听的歌呢?
- 05-13· 小园子的惊喜
- 05-13· 推荐的电脑配置
- 05-13· 飒飒秋风起,点点胭脂泪
- 05-13· 振作!!
- 05-11· 宏碁/精英有意并购浩鑫
- 05-11· [转]真实:17岁少年在校不
- 05-09· 3、21--3、25成长足迹公布
- 05-09· 和小伙伴闹矛盾(3月5日)
- 05-09· 浩鑫简约 X27D
- 05-09· 今天有点烦躁
- 05-09· 为什么富士康郭台铭最看
- 05-09· 南通热线信息超市_南通汽
- 05-09· [置顶]iPad2零组件供应商剖
- 05-09· 北京富士康科技有限公司
- 05-09· 富士康去年亏损2.18亿美元
- 05-09· 《富士康十二连跳在这以