前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >query+report达到user的需求

query+report达到user的需求

作者头像
Tony老师
发布2020-03-05 11:31:30
3320
发布2020-03-05 11:31:30
举报
文章被收录于专栏:托老师托老师

前几天应USER需求,要查看某一物料当前库存多少,库存在哪个仓库,两周之内对此物料的需求是多少。

写了一query,然后在报表中加如下列内容,达到要求。

select whwmd215.item          | Item from whwmd215               | Item Inventory by Warehouse where  whwmd215.item >= whwmd215.item.f and whwmd215.item <= whwmd215.item.t group by whwmd215.item order by whwmd215.item

报表中的descript:

declaration:

 table twhwmd215  table tgdrmp001  table ttcibd001

     extern domain tcqiv1  wip_162030      extern domain tcqiv1  wip_162035

     extern domain tcqiv1  nor_162012      extern domain tcqiv1  nor_162013      extern domain tcqiv1  nor_162020      extern domain tcqiv1  nor_162025      extern domain cpcom.quan  pdemg_1      extern domain cpcom.quan  pdemg_2

 domain cpcom.dydt  pdate.g  domain tcmcs.long  count

before.program:   pdate.g = date.num() 

detail.1: before.layout:

| message (Str$(pdate.g))

 select  whwmd215.stoc, whwmd215.cwar, whwmd215.item  from  whwmd215  where  whwmd215._index2 = {:whwmd215.item}  order by  whwmd215._index2  selectdo

  if strip$(whwmd215.cwar)  = "162030" then    wip_162030 = 0    wip_162030 = whwmd215.stoc   endif

  if strip$(whwmd215.cwar)  = "162035" then    wip_162035 = 0    wip_162035 = whwmd215.stoc   endif

  if strip$(whwmd215.cwar)  = "162012" then    nor_162012 = 0    nor_162012 = whwmd215.stoc   endif

  if strip$(whwmd215.cwar)  = "162013" then    nor_162013 = 0    nor_162013 = whwmd215.stoc   endif

  if strip$(whwmd215.cwar)  = "162020" then    nor_162020 = 0    nor_162020 = whwmd215.stoc   endif

  if strip$(whwmd215.cwar)  = "162025" then    nor_162025 = 0    nor_162025 = whwmd215.stoc   endif  endselect

 count =0  select gdrmp001.pdem.g, gdrmp001._index1  from gdrmp001  where gdrmp001._index3 = {"162", 1}  and (gdrmp001.plni.g = :whwmd215.item or    gdrmp001.sitm.g = :whwmd215.item )  and (gdrmp001.pdat.g >= :pdate.g or    gdrmp001.pdat.g <= :pdate.g)  order by gdrmp001._index1  as set with 2 rows  selectdo   count = count + 1   if count = 1 then    pdemg_1 = 0    pdemg_1 = gdrmp001.pdem.g   endif   if count = 2 then    pdemg_2 = 0    pdemg_2 = gdrmp001.pdem.g   endif  endselect

 select  tcibd001.dsca  from tcibd001  where tcibd001._index1 = {:whwmd215.item}  selectdo  selectempty   tcibd001.dsca = ""  endselect

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2008-05-14,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
腾讯云 BI
腾讯云 BI(Business Intelligence,BI)提供从数据源接入、数据建模到数据可视化分析全流程的BI能力,帮助经营者快速获取决策数据依据。系统采用敏捷自助式设计,使用者仅需通过简单拖拽即可完成原本复杂的报表开发过程,并支持报表的分享、推送等企业协作场景。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档