Advertisement
brunobola

Untitled

Jan 3rd, 2023
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.44 KB | None | 0 0
  1. SELECT DISTINCT TOP 100 ci.DATA, ci.Documento, cm.Utilizador AS 'User Gravação | CBL', m.Descricao, CAST(m.DataGravacao AS DATE)
  2. FROM Movimentos m WITH (NOLOCK)
  3.     INNER JOIN CabecMovCBL cm WITH (NOLOCK) ON m.IdCabec = cm.Id
  4.     INNER JOIN CabecInternos ci WITH (NOLOCK) ON cm.IdDocOrig = ci.Id
  5. WHERE m.Documento IN ('CENT') AND m.Serie IN ('2022A')
  6. ORDER BY ci.DATA DESC, ci.Documento, cm.Utilizador, m.Descricao, CAST(m.DataGravacao AS DATE)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement