Q&A for administrators, end users, developers and designers for Craft CMS
Count(*) as Total,
Sum(Case When P.ClosedDate is not Null Then 1 Else 0 End) as Closed,
Round(Cast(Sum(Case When P.ClosedDate is not Null Then 1 Else 0 End) as Decimal)/Count(*)*100, 2) as '% Closed'
From Tags T
Join PostTags PT on PT.TagId = T.Id
Join Posts P on P.Id = PT.PostId and PostTypeId = 1
Where T.TagName = ##TagName:String?homebrew##