SQLTeam.com | Weblogs | Forums

Calculate days ahead for a date to know expiring password date

HI I am trying to accomplish that we would know ahead of time when a staff password is expiring. In the app it is set at 90 days since last change they will be forced to change. I am trying to take the last changed date subtracted against 90 it is hard coded, and the result would be the days until password expires.

Select a.password_change_date, a.login_name, a.end_date, DATEADD(MONTH, -3, a.password_change_date);Password_expiry_date

from staff a

3 months is NOT the same as 90 days. You need to decide which you really want first.