This may be impossible to achieve, and if so how would I re-write my query to still achieve the same results? I keep getting this error:
Msg 130, Level 15, State 1, Line 2 Cannot perform an aggregate function on an expression containing an aggregate or a subquery.
And this is my syntax
select
count(case when username in (select username from database0254.dbo.userinformation) then 1 else 0 end) As [Active User]
,count(case when name in (select fullname from database0254.dbo.names) then 1 else 0 end) As [Valid Name]
From users
While there are other ways and other improvements that could be made, you should be able to simple move part of your logic into a common table expressions (CTE):
Note: we are changing your COUNT to SUM.