SQL Help - collect and calculate the sum of unique items in different invoices

Hello everyone!

I am working on a project where i give the customers an invoice to buy some items from a store
after a while the seller there bring to me several invoices and here I need to collect them and calculate the quantity of items and put price for every item because the price is different every time and then
calculate the total and assign this big invoice to this supplier.
I have 3 tables
invoice, invoice details, payment invoice(to assign invoices to the payment), (table to make the calculation and payment and to assign it to reseller)

I have problem to do select statement that selects the all unique items in the collected invoices under the payment invoice table. can anyone help with this

First, welcome to the community! You might check out the following post, it’s got tons of helpful hints to help you get started.


Inside your app, I hope you’re using references to connect your tables together.

If you are, you can easily pull out a list of all the selected items for each invoice by using a list de-reference formula

If you wrap that with UNIQUE(), you’ll get a list of each item that has been selected for your invoices. :+1:

1 Like