Boolean Expressions in SQL Select list
Use CASE:
SELECT 'Test Name' [col1],
CASE foo
WHEN 'Result' THEN 1
ELSE 0
END AS [col2]
FROM bar
WHERE baz = (some criteria)
Use the case construct:
select 'Test Name',
case when foo = 'Result' then 1 else 0 end
from bar where baz = (some criteria)
Also see the MSDN Transact-SQL CASE documentation.
SELECT 'TestName',
CASE WHEN Foo = 'Result' THEN 1 ELSE 0 END AS TestResult
FROM bar
WHERE baz = @Criteria