Trying to create two calculated columns of count of actions by person, each should count BEFORE and AFTER current date. Query works with one calculated column, but if I add another (commented out), it stops. Can any one help to find error, please? Sorry, had to put spaces here B1. ID and here B2. ID, because forum recognizes them as links.
,count(B1. ID) AS Active
--,count(B2. ID) AS Overdue
JOIN [AppUserRole_RelatedItem] ON [AppUser].ID = [AppUserRole_RelatedItem].UserRole_ID
JOIN [ActionPlan] AS B1 ON [AppUserRole_RelatedItem].Module_ID = B1. ID
--JOIN [ActionPlan] AS B2 ON [AppUserRole_RelatedItem].Module_ID = B2. ID
WHERE [AppUser].Surname = 'Duggan'
AND B1.Proposed_Resolution_Date <= getdate()
--AND B2.Proposed_Resolution_Date > getdate()
GROUP BY [AppUser].Surname