• Okay, so another questions for the experts out there....so as posted above, I'm in the process of attempting to optimize a crazy query, and I think I'm on a good path of using indexed computed columns to rid use of functions in WHERE clauses, i.e.:

    WHERE FILD2.[FirstInvoiceDateKey] <> '-1' --(2:02m 7.9M)

    AND FILD2.[InvoiceLengthMonthNumber] <= round((DATEDIFF(DAY,CAST(LEFT(RIGHT(FILD2.[FirstInvoiceDateKey],4),2) + '/' + RIGHT(FILD2.[FirstInvoiceDateKey],2) + '/'

    + LEFT(FILD2.[FirstInvoiceDateKey],4) AS DATE),CAST(LEFT(RIGHT(FILD2.[OriginalMaturityDateKey],4),2) + '/' + RIGHT(FILD2.[OriginalMaturityDateKey],2)

    + '/' + LEFT(FILD2.[OriginalMaturityDateKey],4) AS DATE)))/(365/12),0)


    My question is, when aliases are used on columns like in the above, i.e. "FILD2", which refers to a subquery that is joined to, earlier in the query, does it affect the computed column and/or prevent it from optimizing the overall query's performance? I just want to clarify, because throughout the overall query, various different aliases are used when subqueries are referring to these same columns. 
    Please let me know if I need to further clarify. Thanks in advance for your valuable insight!