ExcelHome技术论坛

 找回密码
 免费注册

QQ登录

只需一步,快速开始

快捷登录

搜索
EH技术汇-专业的职场技能充电站 妙哉!函数段子手趣味讲函数 Excel服务器-会Excel,做管理系统 效率神器,一键搞定繁琐工作
HR薪酬管理数字化实战 Excel 2021函数公式学习大典 Excel数据透视表实战秘技 打造核心竞争力的职场宝典
让更多数据处理,一键完成 数据工作者的案头书 免费直播课集锦 ExcelHome出品 - VBA代码宝免费下载
用ChatGPT与VBA一键搞定Excel WPS表格从入门到精通 Excel VBA经典代码实践指南
查看: 4460|回复: 6

[分享] 浪潮"内部"资料,绝对经典

[复制链接]

TA的精华主题

TA的得分主题

发表于 2008-4-4 21:18 | 显示全部楼层 |阅读模式
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件       ★免费下载 ★       ★ 使用帮助
<p>把报表计算SQL语句发给大家,希望大家有收获,需要一定SQL基础和浪潮表结构熟悉,能得到什么就看大家的了。</p><p></p>
[此贴子已经被作者于2008-4-5 9:45:26编辑过]

TA的精华主题

TA的得分主题

 楼主| 发表于 2008-4-4 21:22 | 显示全部楼层

浪潮"内部"资料,绝对经典2

<p>go<br/><br/>select F_VAL from BBCONF where F_VKEY='FORCE_ZW'</p><p>go<br/>select F_VAL from BBCONF where F_VKEY='ZW_YJZ'</p><p>go<br/>select count(1) from&nbsp; ZWPZK where ZWPZK_KJND&lt;='2008' and ZWPZK_KJQJ&lt;='03' and ZWPZK_JZF='0' and ZWPZK_WZF='1' and ZWPZK_ZFF='0'</p><p>go<br/>select F_VAL from LSCONF where F_VKEY='ZW_CSNDQJ'</p><p>go<br/>truncate table #bbpznmTmp364</p><p>go<br/>drop table #bbpznmTmp364</p><p>go<br/>create table #bbpznmTmp364 (F_KJND varchar(4) null,F_KJQJ varchar(2) null,F_PZNM varchar(9) null)</p><p>go<br/>create&nbsp; index #bbpznmTmp364 on #bbpznmTmp364 ( F_KJND,F_KJQJ,F_PZNM ) </p><p>go<br/>insert into #bbpznmTmp364(F_KJND,F_KJQJ,F_PZNM )&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; select ZWPZK_KJND,ZWPZK_KJQJ,ZWPZK_PZNM FROM ZWPZK where&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (ZWPZK_KJND&lt;'2008' or </p><p>(ZWPZK_KJND='2008'&nbsp; and ZWPZK_KJQJ&lt;='03'))&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; and ZWPZK_JZF='0' and ZWPZK_WZF='1' and ZWPZK_ZFF='0'</p><p><br/>select count(ZWPZFL_KMBH) from ZWPZFL,#bbpznmTmp364 WHERE ZWPZFL_PZNM=#bbpznmTmp364.F_PZNM</p><p>go<br/>truncate table #bbkmjehz364</p><p>go<br/>drop table #bbkmjehz364</p><p>go<br/>create table #bbkmjehz364 (F_KJND varchar(4)&nbsp; null, F_KJQJ varchar(2)&nbsp; null, F_KMBH varchar(30) null, F_JFJE u001&nbsp; default 0,&nbsp; F_DFJE u001&nbsp; default 0,&nbsp; </p><p>F_JFSL u001&nbsp; default 0,&nbsp; F_DFSL u001&nbsp; default 0) </p><p>go<br/>create&nbsp; index #bbkmjehz364 on #bbkmjehz364 ( F_KJND,F_KJQJ,F_KMBH ) </p><p>go<br/>truncate table #bbkmhztmp364</p><p>go<br/>drop table #bbkmhztmp364</p><p>go<br/>create table #bbkmhztmp364 (F_KJND varchar(4)&nbsp; null, F_KJQJ varchar(2)&nbsp; null, F_KMBH varchar(30) null, F_JE&nbsp;&nbsp; u001&nbsp; default 0,&nbsp; F_SL&nbsp;&nbsp; u001&nbsp; default 0) </p><p>go<br/>create&nbsp; index #bbkmhztmp364 on #bbkmhztmp364 ( F_KJND,F_KJQJ,F_KMBH ) </p><p>go<br/>insert into #bbkmjehz364(F_KJND,F_KJQJ,F_KMBH,F_JFJE,F_JFSL,F_DFJE,F_DFSL) select #bbpznmTmp364.F_KJND,#bbpznmTmp364.F_KJQJ,ZWPZFL_KMBH, round(sum(round</p><p>(ZWPZFL_JE,2)),2), round(sum(round(ZWPZFL_SL,4)),4),0,0 from ZWPZFL,#bbpznmTmp364 WHERE ZWPZFL_PZNM=#bbpznmTmp364.F_PZNM and&nbsp; ZWPZFL_JZFX='1'&nbsp; group by </p><p>F_KJND,F_KJQJ,ZWPZFL_KMBH </p><p>go<br/>insert into #bbkmjehz364(F_KJND,F_KJQJ,F_KMBH,F_JFJE,F_JFSL,F_DFJE,F_DFSL) select #bbpznmTmp364.F_KJND,#bbpznmTmp364.F_KJQJ,ZWKMZD_KMBH, round(sum(round</p><p>(ZWPZFL_JE,2)),2), round(sum(round(ZWPZFL_SL,4)),4),0,0 from ZWKMZD,ZWPZFL,#bbpznmTmp364 WHERE ZWPZFL_PZNM=#bbpznmTmp364.F_PZNM and&nbsp; ZWPZFL_JZFX='1' AND </p><p>CHARINDEX(ZWKMZD_KMBH,ZWPZFL_KMBH)=1 and ZWKMZD_MX=0 group by F_KJND,F_KJQJ,ZWKMZD_KMBH </p><p>go<br/>insert into #bbkmhztmp364(F_KJND,F_KJQJ,F_KMBH,F_JE,F_SL) select #bbpznmTmp364.F_KJND,#bbpznmTmp364.F_KJQJ,ZWPZFL_KMBH, round(sum(round(ZWPZFL_JE,2)),2),&nbsp; </p><p>round(sum(round(ZWPZFL_SL,4)),4)&nbsp; from ZWPZFL,#bbpznmTmp364 WHERE ZWPZFL_PZNM=#bbpznmTmp364.F_PZNM&nbsp; and ZWPZFL_JZFX='2' group by F_KJND,F_KJQJ,ZWPZFL_KMBH </p><p>go<br/>insert into #bbkmhztmp364(F_KJND,F_KJQJ,F_KMBH,F_JE,F_SL) select #bbpznmTmp364.F_KJND,#bbpznmTmp364.F_KJQJ,ZWKMZD_KMBH, round(sum(round(ZWPZFL_JE,2)),2),&nbsp; </p><p>round(sum(round(ZWPZFL_SL,4)),4)&nbsp; from ZWKMZD,ZWPZFL,#bbpznmTmp364 WHERE ZWPZFL_PZNM=#bbpznmTmp364.F_PZNM&nbsp; and ZWPZFL_JZFX='2' AND CHARINDEX</p><p>(ZWKMZD_KMBH,ZWPZFL_KMBH)=1 AND ZWKMZD_MX=0 group by F_KJND,F_KJQJ,ZWKMZD_KMBH </p><p>go<br/>update #bbkmjehz364 set&nbsp; F_DFJE=F_JE,F_DFSL=F_SL&nbsp; from&nbsp; #bbkmjehz364,#bbkmhztmp364 where #bbkmjehz364.F_KJND=#bbkmhztmp364.F_KJND&nbsp; and&nbsp;&nbsp; </p><p>#bbkmjehz364.F_KJQJ=#bbkmhztmp364.F_KJQJ&nbsp; and&nbsp;&nbsp; #bbkmjehz364.F_KMBH=#bbkmhztmp364.F_KMBH </p><p>go<br/>insert into #bbkmjehz364 (F_KJND,F_KJQJ,F_KMBH,F_DFJE,F_DFSL,F_JFJE,F_JFSL )&nbsp; select F_KJND,F_KJQJ,F_KMBH,F_JE,F_SL,0,0&nbsp; from #bbkmhztmp364 where not exists</p><p>(select 1 from #bbkmjehz364 where #bbkmjehz364.F_KJND=#bbkmhztmp364.F_KJND&nbsp; and&nbsp;&nbsp; #bbkmjehz364.F_KJQJ=#bbkmhztmp364.F_KJQJ&nbsp; and&nbsp;&nbsp; </p><p>#bbkmjehz364.F_KMBH=#bbkmhztmp364.F_KMBH)</p><p>go<br/>truncate table #bbkmhztmp364</p><p>go<br/>drop table #bbkmhztmp364</p><p>go<br/>select count(ZWKMZD_KMBH) from ZWKMZD,ZWPZFL,#bbpznmTmp364 WHERE ZWKMZD_KMBH=ZWPZFL_KMBH AND ZWKMZD_HSWB&lt;&gt;'0' AND ZWPZFL_PZNM=#bbpznmTmp364.F_PZNM</p><p>go<br/>select count(ZWFZYS_KMBH) from ZWFZYS,#bbpznmTmp364 WHERE ZWFZYS_PZNM=#bbpznmTmp364.F_PZNM</p><p>go<br/>truncate table #bbfzjehz364</p><p>go<br/>drop table #bbfzjehz364</p><p>go<br/>create table #bbfzjehz364 (F_KJND varchar(4)&nbsp; null,&nbsp; F_KJQJ varchar(2)&nbsp; null,&nbsp; F_KMBH varchar(30) null,&nbsp; F_BMBH varchar(20) null,&nbsp; F_DWBH varchar(20) null,&nbsp; </p><p>F_ZGBH varchar(20) null,&nbsp; F_XM01 varchar(20) null,&nbsp; F_XM02 varchar(20) null,&nbsp; F_XM03 varchar(20) null,&nbsp; F_XM04 varchar(20) null,&nbsp; F_XM05 varchar(20) null,&nbsp; </p><p>F_JFJE u001&nbsp; default 0,&nbsp; F_DFJE u001&nbsp; default 0,&nbsp; F_JFSL u001&nbsp; default 0,&nbsp; F_DFSL u001&nbsp; default 0) </p><p>go<br/>create&nbsp; index #bbfzjehz364 on #bbfzjehz364 ( F_KJND,F_KJQJ,F_KMBH,F_BMBH,F_DWBH,F_ZGBH,F_XM01 ) </p><p>go<br/>truncate table #bbfzhztmp364</p><p>go<br/>drop table #bbfzhztmp364</p><p>go<br/>create table #bbfzhztmp364 (F_KJND varchar(4)&nbsp; null,&nbsp; F_KJQJ varchar(2)&nbsp; null,&nbsp; F_KMBH varchar(30) null,&nbsp; F_BMBH varchar(20) null,&nbsp; F_DWBH varchar(20) null,&nbsp; </p><p>F_ZGBH varchar(20) null,&nbsp; F_XM01 varchar(20) null,&nbsp; F_XM02 varchar(20) null,&nbsp; F_XM03 varchar(20) null,&nbsp; F_XM04 varchar(20) null,&nbsp; F_XM05 varchar(20) null,&nbsp; </p><p>F_JE u001&nbsp; default 0,&nbsp; F_SL u001&nbsp; default 0) </p><p>go<br/>create&nbsp; index #bbfzhztmp364 on #bbfzhztmp364 ( F_KJND,F_KJQJ,F_KMBH,F_BMBH,F_DWBH,F_ZGBH,F_XM01 ) </p><p>go<br/>insert into #bbfzjehz364(F_KJND,F_KJQJ,F_KMBH,F_BMBH,F_DWBH,F_ZGBH,F_XM01,F_XM02,F_XM03,F_XM04,F_XM05,F_JFJE,F_JFSL,F_DFJE,F_DFSL) select </p><p>#bbpznmTmp364.F_KJND,#bbpznmTmp364.F_KJQJ,ZWFZYS_KMBH,ISNULL(ZWFZYS_BMBH,' '),ISNULL(ZWFZYS_DWBH,' '),ISNULL(ZWFZYS_ZGBH,' '),ISNULL(ZWFZYS_XM01,' '),ISNULL</p><p>(ZWFZYS_XM02,' '),ISNULL(ZWFZYS_XM03,' '),ISNULL(ZWFZYS_XM04,' '),ISNULL(ZWFZYS_XM05,' '),&nbsp; round(sum(round(ZWFZYS_JE,2)),2),&nbsp; round(sum(round</p><p>(ZWFZYS_SL,4)),4),0,0&nbsp; from ZWFZYS,#bbpznmTmp364 WHERE ZWFZYS_PZNM=#bbpznmTmp364.F_PZNM and&nbsp; ZWFZYS_JZFX='1' group by F_KJND,F_KJQJ,ZWFZYS_KMBH,isnull</p><p>(ZWFZYS_BMBH,' '),isnull(ZWFZYS_DWBH,' '),isnull(ZWFZYS_ZGBH,' '),isnull(ZWFZYS_XM01,' '),isnull(ZWFZYS_XM02,' '),isnull(ZWFZYS_XM03,' '),isnull</p><p>(ZWFZYS_XM04,' '),isnull(ZWFZYS_XM05,' ') </p><p>go<br/>insert into #bbfzhztmp364(F_KJND,F_KJQJ,F_KMBH,F_BMBH,F_DWBH,F_ZGBH,F_XM01,F_XM02,F_XM03,F_XM04,F_XM05,F_JE,F_SL) select </p><p>#bbpznmTmp364.F_KJND,#bbpznmTmp364.F_KJQJ,ZWFZYS_KMBH,ISNULL(ZWFZYS_BMBH,' '),ISNULL(ZWFZYS_DWBH,' '),ISNULL(ZWFZYS_ZGBH,' '),ISNULL(ZWFZYS_XM01,' '),ISNULL</p><p>(ZWFZYS_XM02,' '),ISNULL(ZWFZYS_XM03,' '),ISNULL(ZWFZYS_XM04,' '),ISNULL(ZWFZYS_XM05,' '), round(sum(round(ZWFZYS_JE,2)),2),&nbsp; round(sum(round</p><p>(ZWFZYS_SL,4)),4)&nbsp; from ZWFZYS,#bbpznmTmp364 WHERE ZWFZYS_PZNM=#bbpznmTmp364.F_PZNM&nbsp; and ZWFZYS_JZFX='2' group by F_KJND,F_KJQJ,ZWFZYS_KMBH,ISNULL</p><p>(ZWFZYS_BMBH,' '),ISNULL(ZWFZYS_DWBH,' '),ISNULL(ZWFZYS_ZGBH,' '),ISNULL(ZWFZYS_XM01,' '),ISNULL(ZWFZYS_XM02,' '),ISNULL(ZWFZYS_XM03,' '),ISNULL</p><p>(ZWFZYS_XM04,' '),ISNULL(ZWFZYS_XM05,' ') </p><p>go<br/>update #bbfzjehz364 set F_DFJE= F_JE,F_DFSL=F_SL FROM&nbsp; #bbfzjehz364,#bbfzhztmp364 where #bbfzjehz364.F_KJND=#bbfzhztmp364.F_KJND&nbsp; and&nbsp;&nbsp; </p><p>#bbfzjehz364.F_KJQJ=#bbfzhztmp364.F_KJQJ&nbsp; and&nbsp;&nbsp; #bbfzjehz364.F_KMBH=#bbfzhztmp364.F_KMBH&nbsp; and&nbsp;&nbsp; #bbfzjehz364.F_BMBH=#bbfzhztmp364.F_BMBH&nbsp; and&nbsp;&nbsp; </p><p>#bbfzjehz364.F_DWBH=#bbfzhztmp364.F_DWBH&nbsp; and&nbsp;&nbsp; #bbfzjehz364.F_ZGBH=#bbfzhztmp364.F_ZGBH&nbsp; and&nbsp;&nbsp; #bbfzjehz364.F_XM01=#bbfzhztmp364.F_XM01&nbsp; and&nbsp;&nbsp; </p><p>#bbfzjehz364.F_XM02=#bbfzhztmp364.F_XM02&nbsp; and&nbsp;&nbsp; #bbfzjehz364.F_XM03=#bbfzhztmp364.F_XM03&nbsp; and&nbsp;&nbsp; #bbfzjehz364.F_XM04=#bbfzhztmp364.F_XM04&nbsp; and&nbsp;&nbsp; </p><p>#bbfzjehz364.F_XM05=#bbfzhztmp364.F_XM05 </p><p>go<br/>insert into #bbfzjehz364 (F_KJND,F_KJQJ,F_KMBH,F_BMBH,F_DWBH,F_ZGBH,F_XM01,F_XM02,F_XM03,F_XM04,F_XM05,F_DFJE,F_DFSL,F_JFJE,F_JFSL )&nbsp; select </p><p>F_KJND,F_KJQJ,F_KMBH,F_BMBH,F_DWBH,F_ZGBH,F_XM01,F_XM02,F_XM03,F_XM04,F_XM05,F_JE,F_SL,0,0 from #bbfzhztmp364 where not exists(select 1 from #bbfzjehz364 </p><p>where #bbfzjehz364.F_KJND=#bbfzhztmp364.F_KJND&nbsp; and&nbsp;&nbsp; #bbfzjehz364.F_KJQJ=#bbfzhztmp364.F_KJQJ&nbsp; and&nbsp;&nbsp; #bbfzjehz364.F_KMBH=#bbfzhztmp364.F_KMBH&nbsp; and&nbsp;&nbsp; </p><p>#bbfzjehz364.F_BMBH=#bbfzhztmp364.F_BMBH&nbsp; and&nbsp;&nbsp; #bbfzjehz364.F_DWBH=#bbfzhztmp364.F_DWBH&nbsp; and&nbsp;&nbsp; #bbfzjehz364.F_ZGBH=#bbfzhztmp364.F_ZGBH&nbsp; and&nbsp;&nbsp; </p><p>#bbfzjehz364.F_XM01=#bbfzhztmp364.F_XM01&nbsp; and&nbsp;&nbsp; #bbfzjehz364.F_XM02=#bbfzhztmp364.F_XM02&nbsp; and&nbsp;&nbsp; #bbfzjehz364.F_XM03=#bbfzhztmp364.F_XM03&nbsp; and&nbsp;&nbsp; </p><p>#bbfzjehz364.F_XM04=#bbfzhztmp364.F_XM04&nbsp; and&nbsp;&nbsp; #bbfzjehz364.F_XM05=#bbfzhztmp364.F_XM05)</p><p>go<br/>truncate table #bbfzhztmp364</p><p>go<br/>drop table #bbfzhztmp364</p><p>go<br/>select count(ZWFZYS_KMBH) from ZWFZYS,ZWKMZD,#bbpznmTmp364 WHERE ZWKMZD_KMBH=ZWFZYS_KMBH AND ZWKMZD_HSWB&lt;&gt;'0' AND ZWFZYS_PZNM=#bbpznmTmp364.F_PZNM</p><p>go<br/>truncate table ZWKMJEBB364</p><p>go<br/>insert into ZWKMJEBB364 select * from ZWKMJE where ZWKMJE_KJND&lt;='2008'</p><p>go<br/>truncate table ZWKMSLBB364</p><p>go<br/>insert into ZWKMSLBB364 select * from ZWKMSL where ZWKMSL_KJND&lt;='2008'</p><p>go<br/>truncate table ZWKMWBBB364</p><p>go<br/>insert into ZWKMWBBB364 select * from ZWKMWB where ZWKMWB_KJND&lt;='2008'</p><p>go<br/>truncate table ZWFZJEBB364</p><p>go<br/>insert into ZWFZJEBB364 select * from ZWFZJE where ZWFZJE_KJND&lt;='2008'</p><p>go<br/>truncate table ZWFZSLBB364</p><p>go<br/>insert into ZWFZSLBB364 select * from ZWFZSL where ZWFZSL_KJND&lt;='2008'</p><p>go<br/>truncate table ZWFZWBBB364</p><p>go<br/>insert into ZWFZWBBB364 select * from ZWFZWB where ZWFZWB_KJND&lt;='2008'</p><p>go<br/>select F_KJND,F_KJQJ from #bbpznmTmp364 group by F_KJND,F_KJQJ order by F_KJND,F_KJQJ </p><p>go<br/>UPDATE ZWKMJEBB364 SET&nbsp; ZWKMJE_DQYE=round(round(ZWKMJE_DQYE,2)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; +round(#bbkmjehz364.F_JFJE,2)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -round(#bbkmjehz364.F_DFJE,2),2)&nbsp; </p><p>FROM ZWKMJEBB364,#bbkmjehz364 WHERE ZWKMJE_KJND='2007' AND ZWKMJE_KJQJ&gt;='06' AND F_KJND='2007' AND F_KJQJ='06' AND ZWKMJE_KMBH=#bbkmjehz364.F_KMBH&nbsp; AND </p><p>ZWKMJE_KMBH IN(SELECT ZWKMZD_KMBH FROM ZWKMZD WHERE ZWKMZD_XZ='0') </p><p>go<br/>UPDATE ZWKMJEBB364 SET&nbsp; ZWKMJE_NCYE= round(round(ZWKMJE_NCYE,2)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; +round(#bbkmjehz364.F_JFJE,2)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -round</p><p>(#bbkmjehz364.F_DFJE,2),2),&nbsp; ZWKMJE_DQYE=round(round(ZWKMJE_DQYE,2)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; +round(#bbkmjehz364.F_JFJE,2)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -round</p><p>(#bbkmjehz364.F_DFJE,2),2)&nbsp; FROM ZWKMJEBB364,#bbkmjehz364 WHERE ZWKMJE_KJND='2008'&nbsp; AND F_KJND='2007' AND F_KJQJ='06' AND ZWKMJE_KMBH=#bbkmjehz364.F_KMBH&nbsp; </p><p>AND ZWKMJE_KMBH IN(SELECT ZWKMZD_KMBH FROM ZWKMZD WHERE ZWKMZD_XZ='0') </p><p>go<br/>UPDATE ZWKMJEBB364 SET&nbsp; ZWKMJE_JFLJ=round(round(ZWKMJE_JFLJ,2)+round(#bbkmjehz364.F_JFJE,2),2), ZWKMJE_DFLJ=round(round(ZWKMJE_DFLJ,2)+round</p><p>(#bbkmjehz364.F_DFJE,2),2) FROM ZWKMJEBB364,#bbkmjehz364 WHERE ZWKMJE_KJND='2007' AND ZWKMJE_KJQJ&gt;='06' AND F_KJND='2007' AND F_KJQJ='06'&nbsp; AND </p><p>ZWKMJE_KMBH=#bbkmjehz364.F_KMBH </p><p>go<br/>UPDATE ZWKMJEBB364 SET&nbsp; ZWKMJE_JFFS=round(round(ZWKMJE_JFFS,2)+round(#bbkmjehz364.F_JFJE,2),2), ZWKMJE_DFFS=round(round(ZWKMJE_DFFS,2)+round</p><p>(#bbkmjehz364.F_DFJE,2),2) FROM ZWKMJEBB364,#bbkmjehz364 WHERE ZWKMJE_KJND='2007' AND ZWKMJE_KJQJ='06' AND F_KJND='2007' AND F_KJQJ='06'&nbsp; AND </p><p>ZWKMJE_KMBH=#bbkmjehz364.F_KMBH </p><p>go<br/>UPDATE ZWKMSLBB364 SET&nbsp; ZWKMSL_DQYE=round(round(ZWKMSL_DQYE,4)+round(#bbkmjehz364.F_JFSL,4)-round(#bbkmjehz364.F_DFSL,4),4)&nbsp; FROM ZWKMSLBB364,#bbkmjehz364 </p><p>WHERE ZWKMSL_KJND='2007' AND ZWKMSL_KJQJ&gt;='06' and F_KJND='2007' and F_KJQJ='06'&nbsp; AND ZWKMSL_KMBH=#bbkmjehz364.F_KMBH&nbsp; AND ZWKMSL_KMBH IN(SELECT ZWKMZD_KMBH </p><p>FROM ZWKMZD WHERE ZWKMZD_XZ='0') </p><p>go<br/>UPDATE ZWKMSLBB364 SET&nbsp; ZWKMSL_NCYE=round(round(ZWKMSL_NCYE,4)+round(#bbkmjehz364.F_JFSL,4)-round(#bbkmjehz364.F_DFSL,4),4),&nbsp; ZWKMSL_DQYE=round(round</p><p>(ZWKMSL_DQYE,4)+round(#bbkmjehz364.F_JFSL,4)-round(#bbkmjehz364.F_DFSL,4),4)&nbsp; FROM ZWKMSLBB364,#bbkmjehz364 WHERE ZWKMSL_KJND='2008' and F_KJND='2007' and </p><p>F_KJQJ='06'&nbsp; AND ZWKMSL_KMBH=#bbkmjehz364.F_KMBH&nbsp; AND ZWKMSL_KMBH IN(SELECT ZWKMZD_KMBH FROM ZWKMZD WHERE ZWKMZD_XZ='0') </p><p>go<br/>UPDATE ZWKMSLBB364 SET&nbsp; ZWKMSL_JFLJ=round(round(ZWKMSL_JFLJ,4)+round(#bbkmjehz364.F_JFSL,4),4), ZWKMSL_DFLJ=round(round(ZWKMSL_DFLJ,4)+round</p><p>(#bbkmjehz364.F_DFSL,4),4) FROM ZWKMSLBB364,#bbkmjehz364 WHERE ZWKMSL_KJND='2007' AND ZWKMSL_KJQJ&gt;='06' and F_KJND='2007' and F_KJQJ='06'&nbsp; AND </p><p>ZWKMSL_KMBH=#bbkmjehz364.F_KMBH </p><p>go<br/>UPDATE ZWKMSLBB364 SET&nbsp; ZWKMSL_JFFS=round(round(ZWKMSL_JFFS,4)+round(#bbkmjehz364.F_JFSL,4),4), ZWKMSL_DFFS=round(round(ZWKMSL_DFFS,4)+round</p><p>(#bbkmjehz364.F_DFSL,4),4) FROM ZWKMSLBB364,#bbkmjehz364 WHERE ZWKMSL_KJND='2007' AND ZWKMSL_KJQJ='06' and F_KJND='2007' and F_KJQJ='06'&nbsp; AND </p><p>ZWKMSL_KMBH=#bbkmjehz364.F_KMBH <br/></p>
[此贴子已经被作者于2008-4-5 9:47:16编辑过]

TA的精华主题

TA的得分主题

 楼主| 发表于 2008-4-4 21:31 | 显示全部楼层
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用  · 内置多项VBA编程加强工具       ★ 免费下载 ★      ★使用手册

不贴了发上附件供大家研究

<p><br/>希望大家多把精力放在报表上,以EXCEL为平台定义函数从财务软件取数,满足大量报表对财务软件数据的需要。上面代码考虑到包含未记账凭证,因为zwkmjebb364这个表,当你重新计算一次整张报表的时候会发生改变,select top 1 name from sysobjects where name like 'zwkmjebb%' and len (name)=(len('zwkmjebb')+3) order by right(name,3)&nbsp; desc将结果赋值给你的VBA中查询表名称,希望大家对代码多改进。</p> XrnPjCuc.rar (4.96 KB, 下载次数: 101) <br/>
[此贴子已经被作者于2008-4-5 9:51:54编辑过]

0mlauIPk.rar

5.97 KB, 下载次数: 94

浪潮"内部"资料,绝对经典

TA的精华主题

TA的得分主题

发表于 2008-5-28 13:18 | 显示全部楼层
希望大家多把精力放在报表上,以EXCEL为平台定义函数从财务软件取数,满足大量报表对财务软件数据的需要。

TA的精华主题

TA的得分主题

发表于 2008-12-5 22:14 | 显示全部楼层

TA的精华主题

TA的得分主题

发表于 2010-4-18 11:05 | 显示全部楼层

你的文件怎么用

你的文件怎么用

TA的精华主题

TA的得分主题

发表于 2010-7-31 22:18 | 显示全部楼层
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用  · 内置多项VBA编程加强工具       ★ 免费下载 ★      ★使用手册
您需要登录后才可以回帖 登录 | 免费注册

本版积分规则

手机版|关于我们|联系我们|ExcelHome

GMT+8, 2024-11-17 09:35 , Processed in 0.047844 second(s), 15 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 1999-2023 Wooffice Inc.

沪公网安备 31011702000001号 沪ICP备11019229号-2

本论坛言论纯属发表者个人意见,任何违反国家相关法律的言论,本站将协助国家相关部门追究发言者责任!     本站特聘法律顾问:李志群律师

快速回复 返回顶部 返回列表