Advertisement
Pandaaaa906

Untitled

Feb 26th, 2023
1,385
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 0.65 KB | None | 0 0
  1. SELECT
  2. so_m.dverifydate 销售订单审核日期,
  3. so_m.cSOCode 销售订单号,
  4. dept.cDepName 部门名称,
  5. inv_cls.cInvCName 品牌,
  6. inv_cls.cInvCCode 存货大类编码,
  7. so_d.cInvCode 存货编码,
  8. so_d.iSum 金额
  9.  
  10. FROM [dbo].[SO_SOMain] so_m
  11.  
  12. LEFT JOIN SO_SODetails so_d
  13. ON so_d.ID = so_m.ID
  14.  
  15. LEFT JOIN Inventory inv
  16. ON inv.cInvCode = so_d.cInvCode
  17.  
  18. LEFT JOIN InventoryClass inv_cls
  19. ON inv_cls.cInvCCode = inv.cInvCCode
  20.  
  21. LEFT JOIN Department dept
  22. ON dept.cDepCode = so_m.cDepCode
  23.  
  24. WHERE so_m.cDepCode = '010405'
  25. AND so_m.dverifydate BETWEEN '2023-02-20' and '2023-02-24'
  26. AND inv_cls.cInvCName = 'CATO'
  27.  
  28. ORDER BY so_m.dverifydate desc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement