Try this one on for size:
select ah_name as object,
ah_idnr as run_nr,
ah_status as status,
ah_timestamp1 as activation,
ah_timestamp2 as start,
ah_timestamp3 as post_proc,
ah_timestamp4 as end
from ah
where ah_otype in ('JOBS','JOBF','SCRI')
and ah_status not between 1900 and 1999
and ah_timestamp2 > current_timestamp - 1 day
and ah_client=100
and ah_timestamp4 is not null;
Notes:
- lines 4-7 -- these times will be displayed in GMT. You may need to adjust those to reflect your current timezone if needed.
- line 9 -- add or remove any other object types from the list as needed
- line 11 -- may need to adjust the syntax based on your DB. (The above code works for DB2.)
- line 12 -- update this to reflect the client you're trying to query