Advertisement
Guest User

Untitled

a guest
Aug 29th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. Stocktaking Table
  2. StoreID Date ProductCode Qty
  3. 1 2016-07-30 11 58
  4. 1 2016-09-30 11 97
  5. 2 2016-08-30 12 15
  6. 2 2016-09-22 55 10
  7. 3 2016-09-05 55 10
  8.  
  9.  
  10. Sale Table
  11. StoreID Date ProductCode Qty
  12. 1 2016-08-30 11 40
  13. 2 2016-08-30 12 3
  14. 2 2016-08-30 55 4
  15. 3 2016-08-30 55 6
  16.  
  17. Desired Output
  18.  
  19.  
  20. StoreID Date Productcode Qty
  21. 1 2016-08-30 11 18
  22. 2 2016-08-30 12 12
  23. 2 2016-08-30 55 6
  24. 3 2016-08-30 55 4
  25.  
  26. @ date1 and @date2 @storeid
  27.  
  28. StoreID Date Productcode Qty
  29. 1 2016-08-30 11 18
  30. 2 2016-08-30 12 12
  31. 2 2016-08-30 55 -4
  32. 3 2016-08-30 55 -6
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement