Himmators Himmators - 4 months ago 10
SQL Question

Add deletedAt future date?

Is it possible to add a deltedAt for a future date in order for it to work as an expiration date?

Answer

Yes you can. If you have a DeletedAt date, you can set it to some date in the future and then, when you run your query, you can specify

WHERE DeletedAt >= @currentDate

Then, anything that has a DeletedAt in the future will be returned. Anything that has passed its DeletedAt date will not be returned.

Comments