Daily Query

来源:http://www.cnblogs.com/morsun/archive/2016/03/05/5244944.html
-Advertisement-
Play Games

-- GI Report SELECT A.PLPKLNBR, D.DNDNHNBR, F.DNSAPCPO, C.PPPRODTE, A.GNUPDDTE GI_DATE, B.INHLDCDE, B.PLCSQNBR, PRSTYCDE, PRCOLCDE, INEXTSIZ, E.CODIVC


 

-- GI Report
SELECT A.PLPKLNBR, D.DNDNHNBR, F.DNSAPCPO, C.PPPRODTE, A.GNUPDDTE  
GI_DATE, B.INHLDCDE, B.PLCSQNBR, PRSTYCDE, PRCOLCDE, INEXTSIZ,     
E.CODIVCDE, D.SHRPRQTY RL_DU, D.SHACPQTY GI_DU, 
( D.SHRPRQTY / CASE WHEN LLPRPFLG = 2 THEN MMDLUQTY                               
    WHEN LLPRPFLG <> 2 THEN 1 END ) RL_PU,  
(D.SHACPQTY / CASE WHEN LLPRPFLG = 2 THEN MMDLUQTY                               
    WHEN LLPRPFLG <> 2 THEN 1 END    ) GI_PU, B.FLFLTCDE          
FROM SHRPLH A, SHRPCA B, SHRPCI C, SHRPLI D, MMRPRD E , PPRSNH F   
WHERE A.PLPKLNBR = B.PLPKLNBR AND B.INHLDCDE = C.INHLDCDE          
AND   B.INHLDCDE = D.INHLDCDE 
AND TRIM(PRSTYCDE )||'-'||TRIM(PRCOLCDE) = E.MMPRDMAT      
AND   D.DNDNHNBR = F.DNDNHNBR                                      
AND   A.SHGISFLG = 'Y' AND A.GNUPDDTE = 20160127 
GI Report
-- carton put away:
SELECT GNJOBUSR ,count(distinct INHLDCDE ) as Carton_PUT_AWAY FROM strrsi WHERE     
gnstscde ='060' and ACACTCDE = 'MCARST' and STPRELOC in (SELECT  
lolocsgt FROM lorloc WHERE LOBLDCDE = 'FW01') and GNUPDDTE =     
20140828 GROUP BY GNJOBUSR                                       

-- carton retrieved:
SELECT GNJOBUSR ,count(distinct INHLDCDE ) as Carton_retrivevd FROM 
strrsi WHERE gnstscde ='060' and ACACTCDE = 'MCARRE' and STPRELOC   
in (SELECT lolocsgt FROM lorloc WHERE LOBLDCDE = 'FW01') and        
GNUPDDTE = 20140828 GROUP BY GNJOBUSR                               
FILE DTL_904 IN NKXPRTEMP WAS CREATED.             

-- pallet put away:
SELECT GNJOBUSR ,count(distinct INHLDCDE ) as Pallet_Put_away     
FROM strrsi WHERE gnstscde ='060' and ACACTCDE =                
'MPALST' and STPRELOC in (SELECT lolocsgt FROM lorloc WHERE     
LOBLDCDE = 'FW01') and GNUPDDTE = 20140828                      
group by GNJOBUSR                                               
FILE DTL_905 IN NKXPRTEMP WAS CREATED.       

-- pallet retrieved:
SELECT GNJOBUSR ,count(distinct INHLDCDE ) as Pallet_retrieved FROM
strrsi WHERE gnstscde ='060' and ACACTCDE = 'MPALRE' and STPRELOC  
in (SELECT lolocsgt FROM lorloc WHERE LOBLDCDE = 'FW01') and       
GNUPDDTE = 20140828 and STTRKUID like 'TT%' GROUP BY GNJOBUSR      
FILE DTL_906 IN NKXPRTEMP WAS CREATED.                             

-- pallet ready:
SELECT GNJOBUSR ,count(distinct INHLDCDE ) as Pallet_to_P_D  
FROM strrsi WHERE gnstscde ='060' and ACACTCDE =             
'PALRDY' and STPRELOC in (SELECT lolocsgt FROM lorloc WHERE  
LOBLDCDE = 'FW01') and GNUPDDTE = 20140828                   
group by GNJOBUSR                                            
FILE DTL_907 IN NKXPRTEMP WAS CREATED.                       

-- to belt pick:
SELECT GNJOBUSR ,count(distinct INHLDCDE ) as Pallet_to_belt     
FROM strrsi WHERE gnstscde ='060' and ACACTCDE =                 
'PPICUP' and STPRELOC in (SELECT lolocsgt FROM lorloc WHERE      
LOBLDCDE = 'FW01') and GNUPDDTE = 20140828                       
group by GNJOBUSR                                                
FILE DTL_908 IN NKXPRTEMP WAS CREATED. 
VNA Report
-- AP Productive Report 

SELECT USR , STYLE, COL, SIZE, UOM, QUA, ISGE, SUM(OP_QTY) OP_QTY,  
SUM( BP_QTY ) BP_QTY, SUM(PA_QTY) PA_QTY FROM ( 
/* Batch Picking Unit */               
SELECT BPUSRPRO USR, BPSTYCDE STYLE,                                
BPCOLCDE COL, BPSIZCDE SIZE, BPUOMCDE UOM, BPPQUCDE QUA,            
BPISGCDE ISGE, 0 AS OP_QTY, BPPIDQTY BP_QTY, 0 PA_QTY               
FROM BPRINS  WHERE BPINSSTS = '060' AND GNUPDDTE = 20151223         
UNION ALL   
/* Order picking Unit */                                                  
SELECT LPUSRPRO USR, PRSTYCDE STYLE, PRCOLCDE COL, INEXTSIZ SIZE,   
MMUOMCDE UOM, COPQUCDE QUA, MMISGCDE ISGE, OPAPKQTY AS OP_QTY, 0 AS 
BP_QTY, 0 PA_QTY FROM OPRPHD WHERE OPPHDSTS = '060' AND GNUPDDTE =  
20151223 AND OPCLUSGT IN (SELECT OPCLUSGT FROM OPRCLU WHERE         
PPRUNNBR IN (SELECT PPRUNNBR FROM PPRPRU WHERE PPRUNTYP IN          
('AP_FLS' , 'NORM' , 'RUSH' , 'SAME' , 'SAMEFS' ) ))                
UNION ALL 
       
/* Packing Unit  */                                                 
SELECT PAUSRCDE USR, PRSTYCDE STYLE, PRCOLCDE COL, INEXTSIZ SIZE,   
MMUOMCDE UOM, COPQUCDE QUA, MMISGCDE ISGE, 0 OP_QTY, 0 BP_QTY,      
SHACPQTY PA_QTY FROM PARSHI WHERE GNUPDDTE = 20151223 AND PASHHSGT  
IN (SELECT PASHHSGT FROM PARSHH WHERE PASHHSTS = '060' AND PPRUNNBR 
IN (SELECT PPRUNNBR FROM PPRPRU WHERE                               
PPRUNTYP IN ('AP_FLS' , 'NORM' , 'RUSH' , 'SAME' , 'SAMEFS' )))     
    ) A  WHERE USR IN (SELECT LPUSRPRO FROM LPSUSR )                
GROUP BY USR , STYLE, COL, SIZE, UOM, QUA, ISGE                     
ORDER BY USR , STYLE, COL, SIZE, UOM, QUA, ISGE 
AP Productive Report
--Cancel Shipping Carton:

-- [email protected]

SELECT A.SHCASDTE "Shipping Date" , A.PLPKLNBR "PackList",        
A.DNSCRCDE "Carrier Code", A.GNCTYCDE "City",b.inhldcde           
"Shipping Carton" , B.PLCSQNBR "Seq Nbr" FROM
shrplh a, shrpca b WHERE A.SHGISFLG = 'Y' and A.PLPKLNBR =        
B.PLPKLNBR and B.GNSTSCDE = '090' and A.SHCASDTE IN (20151225) and      
A.DNSCRCDE in ('YUHA') AND A.SHSTPFLG <> 'Y' ORDER BY B.PLPKLNBR, 
B.PLCSQNBR 
   

-- [email protected]     
                                                    
SELECT A.SHCASDTE "Shipping Date" , A.PLPKLNBR "PackList",        
A.DNSCRCDE "Carrier Code", A.GNCTYCDE "City",b.inhldcde           
"Shipping Carton" , B.PLCSQNBR "Seq Nbr" FROM
shrplh a, shrpca b WHERE A.SHGISFLG = 'Y' and A.PLPKLNBR =        
B.PLPKLNBR and B.GNSTSCDE = '090' and A.SHCASDTE IN (20151225) and      
A.DNSCRCDE in ('HERC') AND A.SHSTPFLG <> 'Y' ORDER BY B.PLPKLNBR, 
B.PLCSQNBR 

-- [email protected]

SELECT A.SHCASDTE "Shipping Date" , A.PLPKLNBR "PackList",        
A.DNSCRCDE "Carrier Code", A.GNCTYCDE "City",b.inhldcde           
"Shipping Carton" , B.PLCSQNBR "Seq Nbr" FROM
shrplh a, shrpca b WHERE A.SHGISFLG = 'Y' and A.PLPKLNBR =        
B.PLPKLNBR and B.GNSTSCDE = '090' and A.SHCASDTE IN (20151225) and      
A.DNSCRCDE in ('RUBO', 'RUBE') AND A.SHSTPFLG <> 'Y' ORDER BY B.PLPKLNBR, 
B.PLCSQNBR 
Cancel Shipping Carton

 


您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • 在平常中我們可以通過使用SQL批量更新或新增更新資料庫數據,對於這些都是有邏輯的數據可以這樣處理但是對於無邏輯的數據我們如何處理(這裡的數據比較多)。 我是通過Excel的方式來處理的。以下已插入為例。 第一步獲取要插入的語句獲取。 INSERT INTO dbo.Tuser( UserName,
  • 上次說了同一個對象裡面不同觸發器的執行順序。今天我也想分享一些我在同一個表裡面,建上不同的唯一約束,不同的唯一索引,看下結果會怎樣 首先簡單建個測試表,不多,就4列 CREATE TABLE AAA3 (ID INT IDENTITY(1,1),Col1 VARCHAR(50),Col2 VARCH
  • 簡易型: C# DBHelper Code using System; using System.Collections.Generic; using System.Text; using System.Data; using System.Data.SqlClient; using System.
  • 修改表名 格式:sp_rename tablename,newtablename sp_rename tablename,newtablename 修改欄位名 格式:sp_rename 'tablename.colname',newcolname,'column' sp_rename 'tablen
  • 資料庫:DB(Database) 資料庫系統:DBS(Database System):是一種虛擬的系統,將多種內容關聯起來的稱呼 DBS = DBMS +DB DBMS:Database Management System,資料庫管理系統,專門管理資料庫 DBA:Database Administ...
  • 在最近的一次優化過程中發現了ORACLE 10g中一個作業EMD_MAINTENANCE.EXECUTE_EM_DBMS_JOB_PROCS執行相當頻繁,其實以前也看到過,只是沒有做過多的瞭解和關註。這個任務在某些版本或某些情況會引起一些性能問題。其實EMD_MAINTENANCE.EXECUTE_...
  • 最近在centos7中通過rpm方式安裝了最新版本的mysql-server 5.7 (mysql57-community-release-el7-7.noarch.rpm) ,發現安裝成功後無法使用root登錄。百度google一番無果,最後在官方文檔中找到了答案。現記錄完整安裝及問題解決過程,希
  • Incorrect syntax near the keyword 'user'
一周排行
    -Advertisement-
    Play Games
  • 移動開發(一):使用.NET MAUI開發第一個安卓APP 對於工作多年的C#程式員來說,近來想嘗試開發一款安卓APP,考慮了很久最終選擇使用.NET MAUI這個微軟官方的框架來嘗試體驗開發安卓APP,畢竟是使用Visual Studio開發工具,使用起來也比較的順手,結合微軟官方的教程進行了安卓 ...
  • 前言 QuestPDF 是一個開源 .NET 庫,用於生成 PDF 文檔。使用了C# Fluent API方式可簡化開發、減少錯誤並提高工作效率。利用它可以輕鬆生成 PDF 報告、發票、導出文件等。 項目介紹 QuestPDF 是一個革命性的開源 .NET 庫,它徹底改變了我們生成 PDF 文檔的方 ...
  • 項目地址 項目後端地址: https://github.com/ZyPLJ/ZYTteeHole 項目前端頁面地址: ZyPLJ/TreeHoleVue (github.com) https://github.com/ZyPLJ/TreeHoleVue 目前項目測試訪問地址: http://tree ...
  • 話不多說,直接開乾 一.下載 1.官方鏈接下載: https://www.microsoft.com/zh-cn/sql-server/sql-server-downloads 2.在下載目錄中找到下麵這個小的安裝包 SQL2022-SSEI-Dev.exe,運行開始下載SQL server; 二. ...
  • 前言 隨著物聯網(IoT)技術的迅猛發展,MQTT(消息隊列遙測傳輸)協議憑藉其輕量級和高效性,已成為眾多物聯網應用的首選通信標準。 MQTTnet 作為一個高性能的 .NET 開源庫,為 .NET 平臺上的 MQTT 客戶端與伺服器開發提供了強大的支持。 本文將全面介紹 MQTTnet 的核心功能 ...
  • Serilog支持多種接收器用於日誌存儲,增強器用於添加屬性,LogContext管理動態屬性,支持多種輸出格式包括純文本、JSON及ExpressionTemplate。還提供了自定義格式化選項,適用於不同需求。 ...
  • 目錄簡介獲取 HTML 文檔解析 HTML 文檔測試參考文章 簡介 動態內容網站使用 JavaScript 腳本動態檢索和渲染數據,爬取信息時需要模擬瀏覽器行為,否則獲取到的源碼基本是空的。 本文使用的爬取步驟如下: 使用 Selenium 獲取渲染後的 HTML 文檔 使用 HtmlAgility ...
  • 1.前言 什麼是熱更新 游戲或者軟體更新時,無需重新下載客戶端進行安裝,而是在應用程式啟動的情況下,在內部進行資源或者代碼更新 Unity目前常用熱更新解決方案 HybridCLR,Xlua,ILRuntime等 Unity目前常用資源管理解決方案 AssetBundles,Addressable, ...
  • 本文章主要是在C# ASP.NET Core Web API框架實現向手機發送驗證碼簡訊功能。這裡我選擇是一個互億無線簡訊驗證碼平臺,其實像阿裡雲,騰訊雲上面也可以。 首先我們先去 互億無線 https://www.ihuyi.com/api/sms.html 去註冊一個賬號 註冊完成賬號後,它會送 ...
  • 通過以下方式可以高效,並保證數據同步的可靠性 1.API設計 使用RESTful設計,確保API端點明確,並使用適當的HTTP方法(如POST用於創建,PUT用於更新)。 設計清晰的請求和響應模型,以確保客戶端能夠理解預期格式。 2.數據驗證 在伺服器端進行嚴格的數據驗證,確保接收到的數據符合預期格 ...