Using TSQL, how can I get the value from a user-defined function by initially calling it in the SELECT clause but then also referencing the result in the WHERE clause? I've tried creating an alias for the result but it cannot resolve the name
SELECT C.dbo.myFunction(n.first, n.last) AS result, <other columns>
FROM C.dbo.Names AS n, <other tables>
WHERE result > 10 AND <other conditions>
Am I going about this correctly?