This line of code is a snippet from my select statement.
frdFreedays - DateDiff(dd,conReceiptToStock,GetDate()) As FreeDaysRemaining
Below
In addition to Aaron's answer, you could use a common table expression:
;with cte_FreeDaysRemaining as
(
select
frdFreedays - DateDiff(dd,conReceiptToStock,GetDate()) As FreeDaysRemaining
--, more columns
from yourtable
)
select
FreeDaysRemaining
--, more columns
from cte_FreeDaysRemaining
where FreeDaysRemaining <= @intFreeDays