Что касается вашего кода, меня беспокоит несколько вещей:
use leads;
-- There's no comma "," after the "*"
select*
-- This look like it belongs in the "from" section as a subquery, eg "(select ...) as sub"
-- You can then reference all of its contents in the main select using "sub.*"
(select max(HighTrw) from (values (trw1), (trw2), (trw21)) as Value(HighTrw)) as [high_trw]
from dbo.spi s
Where (select max(HighTrw)
-- Haven't seen this way of specifying a table before, is it valid?
-- Why not explicitly define a temporary table above with the data you want, _before_ starting the query? - makes the code cleaner/clearer, IMO
from (values (trw1), (trw2), (trw21)) As updatedate (HighTrw)) between '600' and '625'
-- There's no final ";" to terminate the query, might not be absolutely necessary, but good habit,
-- because at some point, this code's going to dovetail into some other code, and the compiler will probably throw a wobbly