MSSQL - count number of rows over time

Hi all

I have a MSSQL table that has the columns dt_error, error_type, error_text, machine_name, call_id, user_id, severity

I want to track the number of errors of a certain type I get an hour - I have spent a lot of time trying to get the query right but am getting the below error. I’m sure I’m doing something simple wrong, please can someone help! Thanks,

mssql: Each GROUP BY expression must contain at least one column that is not an outer reference.

__timeGroup(dt_error,'1h') as time_sec, COUNT(*) as value, 'All' as metric FROM dbo.errorlog WHERE __timeFilter(dt_error)
GROUP BY 1, ‘Test’