>In VFP you can do this
>
>Select somefield+somethingelse as mycalcfield from mytable where mycalcfield>10
>
>in T-SQL it seems you have to do this
>Select somefield+somethingelse as mycalcfield from mytable where somefield+somethingelse>10
>
>which means you have to maintain both calcfield expressions which is a maintenance headache
>
>Is there a way in T-SQL to use the calcfield alias in the where expression?
Brandon,
You can only use calculated field by using them from derived table, e.g.
select * from (select SomeComplexExpression as NewField from myTable) X where NewField > 10
I posted this link today, but it fits again and it's one of my favorites
http://bradsruminations.blogspot.com/2010/01/trolls-puzzle-sql-fable.html
If it's not broken, fix it until it is.
My Blog