Read the fine print on DAYS_UNTIL_PASSWORD_EXPIRES on USER_INFO
<snip>
The number of days until the password will expire. Contains null if the
password will not expire within the number of days specified by the
password expiration warning (QPWDEXPWRN) system value.
</snip>
https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_73/rzajq/rzajqviewuserinfo.htm
Stick to something like
select
AUTHORIZATION_NAME,
DATE_PASSWORD_EXPIRES,
DAYS_UNTIL_PASSWORD_EXPIRES,
days(DATE_PASSWORD_EXPIRES) - days(current date) as
REAL_DAYS_UNTIL_PASSWORD_EXPIRES
from QSYS2.User_info
order by REAL_DAYS_UNTIL_PASSWORD_EXPIRES asc;
"real" will return a null if their password never expires
(DATE_PASSWORD_EXPIRES is null). At least in Run SQL Scripts. Perhaps
that nulls errors? If in doubt, wrap it in an ifnull.
DARREN 2016-11-08 00:00:00.000000 - 42
PEGGY 2016-12-26 00:00:00.000000 - 90
CHRIS 2017-01-04 00:00:00.000000 - 99
CRAIGS 2017-01-09 00:00:00.000000 - 104
KEVINR - - -
Rob Berendt
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact
[javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.