Advertisement
NyteOwlDave

SQL Query

Feb 7th, 2019
423
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.64 KB | None | 0 0
  1. SELECT INPUT.code, [INPUT]![package]-[sold]![quantity package] AS stock_package, [INPUT]![peice]-[sold]![quantity peice] AS [peice balance], INPUT.price, INPUT.[price OF package], INPUT.peice, sellqury.[quantity peice]
  2. INTO myTempTable
  3. FROM ([INPUT] INNER JOIN sellqury ON INPUT.code = sellqury.code) INNER JOIN sold ON INPUT.code = sold.Code
  4. GROUP BY INPUT.code, [INPUT]![package]-[sold]![quantity package], [INPUT]![peice]-[sold]![quantity peice], INPUT.price, INPUT.[price OF package], INPUT.peice, sellqury.[quantity peice];
  5. SELECT
  6.  SUM([quantity peice]) AS [quantity peice],
  7. 'ahmed101' AS [code]
  8. FROM myTempTable WHERE code = 'ahmed101';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement