SQL to get sales by Supplier

Oct 22, 2007 2 Replies

I would like to get output of total sales by supplier via SQL with output like:



Supplier Name Sales



--------------- --------------


If the sales can be formatted like #,###.##, that would be great.



Can someone assist with the SQL query?


I could also use the date and time of the output in the SQL output (FYI, I am using OSQL to output this data to a .txt file).

hi Jason, Try this below is the date paramter you can enter your own date. If works rate this.

Select SupplierName,Sum(TransactionEntry.Price) Sales from [Transaction] INNER JOIN TransactionEntry On [Transaction].TransactionNumber=TransactionEntry.TransactionNumber LEFT JOIN Item ON TransactionEntry.ItemID=Item.ID LEFT JOIN Supplier ON Item.SupplierID=Supplier.ID WHERE [Transaction].Time between '2007-01-01' AND GetDate() Group by SupplierName

"Jas> I would like to get output of total sales by supplier via SQL with output > like: >

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required