SQL - Select objects older than X days

By kimot, 25 December, 2022
SELECT OBJNAME, OBJLIB, OBJTYPE, OBJCREATED, CREATED_SYSTEM, OBJTEXT  
FROM TABLE (QSYS2.OBJECT_STATISTICS('QGPL ','*FILE' ) ) AS X
WHERE DAYS(CURRENT DATE) - DAYS(OBJCREATED) > 1;