Advertisement
Guest User

Untitled

a guest
Sep 20th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. SELECT
  2. *
  3. FROM
  4. vendors v
  5. INNER JOIN
  6. invoices i ON v.vendor_id = i.vendor_id
  7. WHERE
  8. v.vendor_id;
  9. /*------------------------------------------------------------------------------------------*/
  10. SELECT
  11. v.vendor_name,
  12. i.invoice_number,
  13. i.invoice_date,
  14. i.invoice_total - (payment_total + credit_total) AS balance_due
  15. FROM
  16. vendors v
  17. INNER JOIN
  18. invoices i ON v.vendor_id = i.vendor_id
  19. WHERE
  20. invoice_total - (payment_total + credit_total) <> 0
  21. ORDER BY balance_due DESC;
  22. /*------------------------------------------------------------------------------------------*/
  23. SELECT DISTINCT
  24. v.vendor_name,
  25. v.default_account_number AS default_account,
  26. gla.account_description
  27. FROM
  28. vendors v
  29. INNER JOIN
  30. general_ledger_accounts gla ON v.default_account_number = gla.account_number
  31. ORDER BY account_description , vendor_name;
  32. /*------------------------------------------------------------------------------------------*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement