If you can combine the sql that would be best. For example, wherever you are SELECT @usageunitName = ... add that sql to this sql other sql in the where clause.
If you can't you have to do a dynamic sql statement, which is not preferred.
Change your sql to be a string
DECLARE @sql NVARCHAR (MAX)
SELECT @sql = 'SELECT ... FROM ... WHERE field1 = ' + @variable
EXEC (@sql)