Grrr.

OK, how about a subquery factoring clause?

Code:
with sfc as
   (
   select
      DoCalculate(
         aLongitude,
         aLATITUDE,
         a.LONGITUDE,
         a.LATITUDE) mileage_calculated
   from
      TABLEx
   )
select
   mileage_calculated
from
   sfc
where
   mileage_calculated is not null;
'Owzat?