5am start...9pm finish!!! Bugger!
Assuming that you would also like to know the total for each customer, per invoice then use:
Code:
SELECT CustomerName, InvoiceNumber, SUM(InvoiceAmt) AS SubTotal
FROM Customers
GROUP BY CustomerName, InvoiceNumber
ORDER BY CustomerName, InvoiceNumber
If you want to see which Companies have had order worth greater than say £100 then use the following, which is the same as above, but one added line:
Code:
SELECT CustomerName, InvoiceNumber, SUM(InvoiceAmt) AS SubTotal
FROM Customers
GROUP BY CustomerName, InvoiceNumber
HAVING SUM(InvoiceAmt) > 100
ORDER BY CustomerName, InvoiceNumber
Thought you might be interested in that...
Hope it helps,
Woka