博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
完善每日资金下拨的sql
阅读量:5905 次
发布时间:2019-06-19

本文共 2525 字,大约阅读时间需要 8 分钟。

条件max date取值于当天审核后的日期,这样周六的上收也可以取到

更新:fts_voucher_b.pk_account != '1162N51000000000032B'

(select fts_voucher_b.interestdate,       bd_accid.accidcode,       bd_accid.accidname,       fts_voucher_b.creditamount as 上收金额,       (case         when (round(0.35 * fts_voucher_b.localcreditamount / 10000, 0) *              10000) < 100000 then          '0'         else          to_char(round(0.35 * fts_voucher_b.localcreditamount / 10000, 0)) || '万'       end) as 下拨金额,              to_number(substr(bd_custbank.account, -4, 4)) AS 下拨账号,       bd_accbank.remcode as 助记码,       (case         when (round(0.35 * fts_voucher_b.localcreditamount / 10000, 0) *              10000) < 100000 then          fts_voucher_b.creditamount         else          fts_voucher_b.creditamount -          round(0.35 * fts_voucher_b.localcreditamount / 10000, 0) * 10000       end) as 余额  from fts_voucher_b, bd_accid, bd_cubasdoc, bd_custbank, bd_accbank,fts_voucher where bd_custbank.pk_cubasdoc = bd_cubasdoc.pk_cubasdoc   and bd_cubasdoc.custcode = bd_accid.accidcode   and fts_voucher_b.pk_account = bd_accid.pk_accid   and bd_custbank.pk_accbank = bd_accbank.pk_accbank   and fts_voucher.pk_voucher=fts_voucher_b.pk_voucher   and bd_custbank.defflag = 'Y'   and fts_voucher_b.summary = '每日收入户自动归集'   and fts_voucher.auditdate in       (select max(auditdate)          from fts_voucher         where fts_voucher.summary = '每日收入户自动归集')       and fts_voucher_b.pk_account != '1162N51000000000032B'   and bd_accid.accidcode<>'080101')      union     (select fts_voucher_b.interestdate,       bd_accid.accidcode,       bd_accid.accidname,       fts_voucher_b.creditamount as 上收金额,       to_char(0.85 * fts_voucher_b.localcreditamount / 10000) || '万' as 下拨金额,              to_number(substr(bd_custbank.account, -4, 4)) AS 下拨账号,       bd_accbank.remcode as 助记码,       fts_voucher_b.creditamount*0.15  as 余额  from fts_voucher_b, bd_accid, bd_cubasdoc, bd_custbank, bd_accbank,fts_voucher where bd_custbank.pk_cubasdoc = bd_cubasdoc.pk_cubasdoc   and bd_cubasdoc.custcode = bd_accid.accidcode   and fts_voucher_b.pk_account = bd_accid.pk_accid   and bd_custbank.pk_accbank = bd_accbank.pk_accbank   and fts_voucher.pk_voucher=fts_voucher_b.pk_voucher   and bd_custbank.defflag = 'Y'   and fts_voucher_b.summary = '每日收入户自动归集'   and fts_voucher.auditdate in       (select max(auditdate)          from fts_voucher         where fts_voucher.summary = '每日收入户自动归集')     and fts_voucher_b.pk_account != '1162N51000000000032B'   and bd_accid.accidcode='080101')

转载地址:http://hpcpx.baihongyu.com/

你可能感兴趣的文章
Oracle 字符集的查看和修改【上】
查看>>
tomcat注册windows服务
查看>>
使用qq邮箱的smpt服务发送邮件一定要记得用ssl
查看>>
20个非常有用的Java代码片段
查看>>
网站优化和竞价有什么区别
查看>>
MySQL开源热备工具XtraBackup的原理与程序说明
查看>>
mongoDB(1):windows下安装mongoDB(解压缩版)
查看>>
CentOS修改主机名
查看>>
php 5.3.6中php-fpm 配置
查看>>
XMPP协议分析-原理篇
查看>>
centos7常用操作
查看>>
系统集成资质培训 - 新书发布
查看>>
Ubuntu解决RTNETLINK answers: File exists
查看>>
ES6数组去重的最佳实践:Set结合Array.from() | 拓展运算符结合 Set
查看>>
深入屏幕像素概念
查看>>
awk命令的几个选项注释
查看>>
Windows更改临时文件夹
查看>>
django base (1)
查看>>
iRedMail调整附件大小 & Postfix的bcc(自动转发/邮件备份/监控/归档) 在同一个服务器是有压力...
查看>>
唯识相链由来
查看>>