問題已解決

T+憑證摘要,可以一次過全刪除嗎?

84785027| 提問時間:2023 10/12 13:33
溫馨提示:如果以上題目與您遇到的情況不符,可直接提問,隨時問隨時答
速問速答
玲老師
金牌答疑老師
職稱:會計師
你好 可以 模塊: 總賬 【答復】: --當前此腳本修改的是所有組織的憑證摘要,故無組織條件的限制;第二份腳本文件為部分憑證的修改 --注:t_gl_voucher 該表中的憑證摘要不顯示,故修改的是t_gl_voucherenter表 --------------------------------修改憑證摘要-------------------------------- --憑證摘要 select a.* from T_GL_VoucherEntry a inner join t_gl_voucher b on a.FBillID=b.fid inner join T_ORG_Company c on b.FCompanyID=c.fid inner join T_BD_Period d on b.FPeriodID=d.fid where d.fnumber between 201401 and 201411--會計期間 and b.FDescription like %舊字符% --備份 select a.* into T_GL_VoucherEntry_bak from T_GL_VoucherEntry a inner join t_gl_voucher b on a.FBillID=b.fid inner join T_ORG_Company c on b.FCompanyID=c.fid inner join T_BD_Period d on b.FPeriodID=d.fid where d.fnumber between 201401 and 201411--會計期間 and b.FAbstract like %舊字符% --更改數(shù)據(jù) update T_GL_VoucherEntry set FDescription=replace(FDescription,舊,新) where fbillid in (select a.fid from T_GL_Voucher a where a.FPeriodID in (select fid from T_BD_Period where fnumber between 201401 and 201411))--會計期間所在年度 and FDescription like %舊%--舊的字符串 ---------------------------------------------------------------------------- -------------------------------修改輔助賬摘要-------------------------------- --查詢輔助賬摘要 select a.* from T_GL_VoucherAssistRecord a where a.FDescription like %舊字符%--舊字符 and a.FBillID in (select fid from T_GL_Voucher a where a.FPeriodID in (select fid from T_BD_Period where fnumber between 201401 and 201411))--會計期間) --備份將要修改的輔助賬摘要 select a.* into T_GL_VoucherAssistRecord_bak from T_GL_VoucherAssistRecord a where a.FDescription like %舊字符%--舊字符 and a.FBillID in (select fid from T_GL_Voucher a where a.FPeriodID in (select fid from T_BD_Period where fnumber between 201401 and 201411))--會計期間) --修改輔助賬摘要 update T_GL_VoucherAssistRecord ?set FDescription=replace(FDescription,舊字符,新字符) where FDescription like %舊字符%--舊字符 and FBillID in (select fid from T_GL_Voucher a where a.FPeriodID in (select fid from T_BD_Period where fnumber between 201401 and 201411))--會計期間) ---------------------------------------------------------------------------- --此腳本適用于修改部分憑證摘要的問題 --------------------------------修改憑證摘要-------------------------------- --憑證摘要 select a.* from T_GL_VoucherEntry a inner join t_gl_voucher b on a.FBillID=b.fid inner join T_ORG_Company c on b.FCompanyID=c.fid inner join T_BD_Period d on b.FPeriodID=d.fid where d.fnumber between 201401 and 201412--會計期間 and b.FDescription like %新字符% and ?c.FName_L2 = --公司名稱 and b.fnumber=--憑證編碼 --備份 select a.* into T_GL_VoucherEntry_bak from T_GL_VoucherEntry a inner join t_gl_voucher b on a.FBillID=b.fid inner join T_ORG_Company c on b.FCompanyID=c.fid inner join T_BD_Period d on b.FPeriodID=d.fid where d.fnumber between 201401 and 201411--會計期間 and b.FDescription ?like %舊字符% and c.FName_L2=--公司名稱 and b.fnumber=--憑證編碼 --更改數(shù)據(jù) update T_GL_VoucherEntry set FDescription=replace(FDescription,舊,新) where fbillid in (select a.fid from T_GL_Voucher a where fnumber=--憑證編碼 and FCompanyID=(select fid from T_ORG_Company where fname_l2=)--公司名稱 and FPeriodID in (select fid from T_BD_Period where fnumber between 201401 and 201412))--會計期間 and FDescription like %舊%--舊的字符串 ---------------------------------------------------------------------------- -------------------------------修改輔助賬摘要-------------------------------- --查詢輔助賬摘要 select a.* from T_GL_VoucherAssistRecord a where a.FDescription like %舊字符%--舊字符 and a.FBillID in (select fid from T_GL_Voucher a where a.FCompanyID=(select fid from T_ORG_Company where fname_l2=)--組織名稱 and a.fnumber=--憑證編碼 and a.FPeriodID in (select fid from T_BD_Period where fnumber between 201401 and 201412))--會計期間 --備份將要修改的輔助賬摘要 select a.* into t_gl_voucherassistrecord_bak from T_GL_VoucherAssistRecord a where a.FDescription like %舊字符%--舊字符 and a.FBillID in (select fid from T_GL_Voucher a where a.FCompanyID=(select fid from T_ORG_Company where fname_l2=)--組織名稱 and a.fnumber=--憑證編碼 and a.FPeriodID in (select fid from T_BD_Period where fnumber between 201401 and 201412))--會計期間 --修改輔助賬摘要 update T_GL_VoucherAssistRecord set fdescription=replace(fdescription,舊字符,新字符) where FDescription like %舊字符%--舊字符 and FBillID in (select fid from T_GL_Voucher a where a.FCompanyID=(select fid from T_ORG_Company where fname_l2=)--組織名稱 and fnumber=--憑證編碼 and FPeriodID in (select fid from T_BD_Period where fnumber between 201401 and 201412))--會計期間 --
2023 10/12 13:35
描述你的問題,直接向老師提問
0/400
      提交問題

      您有一張限時會員卡待領取

      00:10:00

      免費領取
      Hi,您好,我是基于人工智能技術的智能答疑助手,如果有什么問題可以直接問我呦~