I have a table and I have created a column called AgedRows
. There is a column in the table called createdDate
and the condition is the following
createdDate < DATEADD(DAY, -20, GETUTCDATE())
Then I want to put a 1 in the column, else a 0.
How can I define that check in the “Computed Column Specification” ?
3
Would an IIF statment fit the bill?
IIF(createdDate < DATEADD(DAY, -20, GETUTCDATE()), 1, 0)
0