Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. SELECT a.WebIncrementID as order_ID,b.Quantity,b.[Shipment Date],
  2. CASE when a.No_ = b.[Document No_] THEN 'Shipdata' ELSE 'shipdata' END flag FROM [Tile Mountain$Sales Invoice Header] a
  3. INNER JOIN [Tile Mountain$Sales Invoice Line] b on(a.No_ = b.[Document No_])
  4.  
  5. UNION ALL
  6.  
  7. SELECT a.WebIncrementID as order_ID,c.Quantity,c.[Shipment Date],
  8. CASEwhen a.No_ = c.[Document No_] THEN 'nonShipdata' ELSE 'nonshipdata' END flag FROM [Tile Mountain$Sales Header] a
  9. INNER JOIN [Tile Mountain$Sales Line] c on(a.No_ = c.[Document No_])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement