Advertisement
KyOOOO

Untitled

Aug 15th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. SELECT N'03-Xuất cọc công trường',N'BTL => KHGB', ISNULL(SUM(qty),0)
  2. FROM dbo.matltran m
  3. LEFT JOIN dbo.trnitem t ON m.ref_num = t.trn_num AND t.trn_line = m.ref_line_suf
  4. WHERE
  5. dbo.FAB_ComparePeriod(m.trans_date,@year,@month) = 1
  6. AND LEFT(m.item,2) IN ('AA','AC','AN')
  7. AND m.loc IS NOT NULL
  8. AND m.whse = @whse
  9. AND m.ref_type = 'T'
  10. AND t.from_whse = @whse
  11. AND t.to_whse = 'KHGB'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement