Is there a way to concatenate a field in a SQL statment, in a Stored Procedure, and use the the alias some place else in the same stored procedure. In the below, I know that I can't use 'Amount_Paying', I must use another case statment. Is there a way around using a 2nd case statement. I know I can create a temp table, but I would like to just refer to the alias in the same SQL statment.
Thanks in advance for any help
When tbl_za_Deposit_Start.Amount_Partial_Paying>0 then 0
else tbl_za_Deposit_Start.Amount_Owed + tbl_za_Deposit_Start.New_Adjustment
Amount_Paying + tbl_za_Deposit_Start.P_Pay AS Tot
WHERE tbl_za_Deposit_Start.Paying = 1