can you please help,
I use below code to select from table.
The issue I have is with TAX1,
TAX1 includes 6 taxes (PST_BC, HST, GST, HST_PEI, HST_ON, HST_NS)
I need to have separate SUM for each tax.
SUM (GST) ...
P Lease see attached.
Select SUM (SubtotalAmount) AS [SubtotalAmount],SUM (Tax1Amount) AS [TAX1],SUM (Tax2Amount) AS [TVQ],SUM (TotalAmount) AS [TotalAmount]
INNER JOIN FinalizedOrdersInvoices ON FinalizedOrdersInvoices.Or
derNo = FinalizedOrders.OrderNo
r = (Select Distinct InvoiceNumber From (Select InvoiceNumber, orderno From finalizedordersinvoices
Where Invoicenumber = (Select top 1 invoicenumber from finalizedordersinvoices i inner join finalizedorders o on o.orderno= i.orderno where ((AccountNumber = 116)) order by Invoicenumber desc))
foi left join finalizedorders fo on fo.orderno = foi.orderno WHERE ((AccountNumber = 116)))