zoukankan      html  css  js  c++  java
  • 一个SQL语句

    • select'汇报单号' = t2.FBillNo, 
    •        '输入人员' = (select FName from t_User where FUserID = t2.FBillerID), 
    •        '审核人员' = (select FName from t_User where FUserID = t2.FCheckerID),
    •        '汇报车间' = (select FName from t_Department where FItemID = t2.FWorkShop), 
    •        '实际开工时间' = convert(varchar(10),t1.FWorkStartDate,120), 
    •        '实际完工时间' = convert(varchar(10),t1.FWorkEndDate,120), 
    •        '本次实作数量' = t1.FQtyFinish, 
    •        '本次遗失数量' = t1.FQtyLoss, 
    •        '本次合格数量' = t1.FQtyPass, 
    •        '本次因工报废数' = t1.FQtyScrap, 
    •        '本次因料报废数' = t1.FQtyForItem, 
    •        '工单号' = t1.FSourceBillNo, 
    •        '物料号码' = t3.FNumber, 
    •        '物料名称' = t3.FName, 
    •        '规格型号' = t3.FModel, 
    •        '工单数量' = t4.FQty, 
    •        '单位' = ( select FName from t_MeasureUnit where FMeasureUnitID = t4.FUnitID), 
    •        '批次' = t4.FGMPBatchNo, 
    •        '工单状态' = (case t4.FStatus when 0 then'计划'when 3 then'结案'when 5 then'确认'  else'下达'end), 
    •        '派工车间' = (select FName from t_Department where FItemID = t4.FWorkShop), 
    •        '计划开工时间' = convert(varchar(10),t4.FPlanCommitDate,120), 
    •        '计划完工时间' = convert(varchar(10),t4.FPlanFinishDate,120), 
    •        '累计实做数' = t4.FQtyFinish, 
    •        '累计遗失数' = t4.FQtyLost, 
    •        '累计因工报废数' = t4.FQtyScrap, 
    •        '累计因料报废数' = t4.FQtyForItem, 
    •        '累计合格数' = t4.FQtyPass, 
    •        '累计入库数' = t4.FStockQty  
    • from IcmoRptEntry t1, IcmoRpt t2 ,t_ICItem t3,Icmo t4  
    • Where  
    •      t2.FCheckDate between'********'  and  '########'  
    •      and (t1.FSourceBillNo like'%@FSourceBillNo@%'orisnull('@FSourceBillNo@','')='')  
    •      and (t2.FWorkShop in (select FItemID from t_Department where FName like'%@DeptName@%'orisnull('@DeptName@','') = ''
    •      and t1.FInterID = t2.FInterID  
    •      and t1.FSourceInterID=t4.FInterId 
    •      and t3.FItemID = t4.FItemID 
    •      and t1.FSourcetrantype=85  
    •      and t4.FTrantype=85   
    •      and t2.FStatus > 0 
    • orderby t2.FBillNo 
  • 相关阅读:
    页面灰色样式
    替换页面中出现的链接
    Google Earth无法连接到服务器
    知识扩展(线程SQL、SMTP、POP3、反射)
    oracle 11g 客户端 连接数据库
    Oracle 下载|ORACLE 官网下载地址(支持win7/win2008)
    WCF返回xml
    IE和FireFox下的JS调试工具
    在IIS中部署WCF服务出现authentication mode=windows
    Ext入门(Window、Panel、Viewport、Grid、Form、TreePanel)
  • 原文地址:https://www.cnblogs.com/cyjch/p/2420891.html
Copyright © 2011-2022 走看看