Run query against all databases on server containing specific string in name
You may try to generate a dynamic statement. 

Basic example:

-- Declarations
DECLARE @stm nvarchar(max)
DECLARE @err int
SET @stm = N''

-- Dymanic statement
SELECT @stm = @stm + CONCAT(N'SELECT * FROM [', [name] , N'].sys.tables ')
FROM sys.databases
WHERE [name] LIKE '%the%'

-- Execution
EXEC @err = sp_executesql @stm


Example with your statement:

-- Declarations
DECLARE @stm nvarchar(max)
DECLARE @err int
SET @stm = N''

-- Dymanic statement
SELECT @stm = 
    @stm + 
    CONCAT(
    N'SELECT convert(varchar, DateTime, 100) AS "Date and Time", Text2 AS Area, Substring(PText7, 1,Charindex('':'', PText7)-1) AS Username FROM [', 
    [name] , 
    N'].dbo.AlgViewENU AS data
    WHERE PText6 LIKE ''%BypIn%'' AND [DateTime] = (SELECT MAX(DateTime) FROM [',
    [name] , 
    N'].dbo.AlgViewENU WHERE Text1 = data.Text1 AND PText6 LIKE ''Set%''); '
    )
FROM sys.databases
WHERE [name] LIKE '%the%'

-- Execution
PRINT @stm
EXEC @err = sp_executesql @stm