Hello garethtnash,
SELECT
E.JBEID,
E.JBEName,
E.JBEUsername,
E.JBELevel,
LA.LiveAdverts,
EA.ExpiredAdverts,
(ISNULL(LA.LiveAdverts,0) + ISNULL( EA.ExpiredAdverts, 0) ) as totalAdverts
From dbo.JBEmployee E
Left Join (Select LA.JBAEmployeeID, COUNT(LA.JBAID) LiveAdverts FROM dbo.JBAdvert LA GROUP BY LA.JBAEmployeeID) LA on LA.JBAEmployeeID = E.JBEID
Left Join (Select EA.JBAEmployeeID, COUNT(EA.JBAID) ExpiredAdverts FROM dbo.JBExpiredAdvert EA GROUP BY EA.JBAEmployeeID) EA on EA.JBAEmployeeID = E.JBEID
where E.JBEClientID = 18 AND E.JBEID <> 30
Regards,
Aneesh