Further to the comments and solution above...
You have many things like
CONVERT(char(10),CaptureDate,111) AS 'CaptureDate',
Why? Use dates properly and only convert them to a "readable" format when you are presenting them in the UI.
Same applies to things like
CAST(fkUserID as varchar(255))
Consider simplifying that awful WHERE clause by utilising temporary table(s) or table variable(s) - see comment from @ZurdoDev
If you are using SQL Server 2017 or higher replace
LTRIM(RTRIM(Note))
with
TRIM(Note)
You should try to rethink your sub-query inside a sub-query inside a where . . .
SELECT CAST(fkUserID as varchar(255))
FROM SystemControl_Live.dbo.aa_UserTaskGroup
WHERE fkTaskGroupID IN
(
SELECT fkTaskGroupID
FROM SystemControl_Live.dbo.aa_UserTaskGroup
WHERE fkUserID = @UserID
)
I think that this should work just as well (worth checking with your data though)
SELECT CAST(A.fkUserID as varchar(255))
FROM SystemControl_Live.dbo.aa_UserTaskGroup A
INNER JOIN SystemControl_Live.dbo.aa_UserTaskGroup B ON A.fkTaskGroupID = B.fkTaskGroupID AND B.fkUserID = @userID