Hi everyone,
I’m not sure if this is a SubQuery or not, but may I ask for some help please ?
I have 2 queries, the first is :-
Code:
SELECT Clients.Clientname,
SUM(Items.Itemexvat) AS [ExTax],
SUM(Items.Itemvatamount) AS [Tax],
SUM(Items.Itemincvat) AS [IncTax]
FROM (((Clients INNER JOIN Jobs ON Clients.Clientid = Jobs.Jobtoclients)
INNER JOIN Suppliers ON Jobs.Jobspri = Suppliers.Suppliertojobs)
INNER JOIN Invoices ON Suppliers.Supplierpri = Invoices.Invoicetosuppliers)
INNER JOIN Items ON Invoices.Invoicepri = Items.Itemtoinvioice
GROUP BY Clients.Clientname;
Code:
ClientName ExTax Tax IncTax
Client A 1000 100 1100
Client B 1500 150 1650
Client C 2000 200 2200
Code:
SELECT Clients.Clientname,
COUNT(Jobs.Nickname) AS [JobCount]
FROM Clients
INNER JOIN Jobs ON Clients.Clientid = Jobs.Jobtoclients
GROUP BY Clients.Clientname;
Code:
ClientName JobCount
Client A 2
Client B 1
Client C 2
Could someone show me how I could have a DataSet looking this this, please :-
Code:
ClientName JobCount ExTax Tax IncTax
Client A 2 1000 100 1100
Client B 1 1500 150 1650
Client C 2 2000 200 2200
Many thanks,
Amy.