Hi
I have a sql(made with help fra this thread220-903346) that select the number of minutes a timestamp is after 9:00
there are 2 problems, I seem to get the times where the job is pricisly 9:00 and also the ones where the hours is 00:
This is my SQL
select ETL_PROGRAM.program_name, to_char(ETL_PROGRAM_log.program_end, 'yyyy-mm--dd-dy hh24:mi'),
to_char(ETL_PROGRAM_log.program_end, 'HH24')*60 + to_char(ETL_PROGRAM_log.program_end, 'MI') - 540 as minutes
from ETL_PROGRAM_log, ETL_PROGRAM
where ETL_PROGRAM_log.program_id = ETL_PROGRAM.program_id
and ETL_PROGRAM.program_name = 'END_CYCLE'
and to_char(ETL_PROGRAM_log.program_end, 'YYYYMM')='200401'
and to_char(ETL_PROGRAM_log.program_end, 'DY') != 'SAT'
and to_char(ETL_PROGRAM_log.program_end, 'DY') != 'SUN'
and to_char(ETL_PROGRAM_log.program_end, 'HH:MM') > '09:01'
And this is my Output
END_CYCLE, 2004-01--02-fre 00:59, -481
END_CYCLE, 2004-01--02-fre 12:31, 211
END_CYCLE, 2004-01--08-tor 09:00, 0
The first line should not be there, becouse it is only 00:59 witch is way before 9:00
And the last line should not either becourse it is at 09:00
Thanks
Larshg
I have a sql(made with help fra this thread220-903346) that select the number of minutes a timestamp is after 9:00
there are 2 problems, I seem to get the times where the job is pricisly 9:00 and also the ones where the hours is 00:
This is my SQL
select ETL_PROGRAM.program_name, to_char(ETL_PROGRAM_log.program_end, 'yyyy-mm--dd-dy hh24:mi'),
to_char(ETL_PROGRAM_log.program_end, 'HH24')*60 + to_char(ETL_PROGRAM_log.program_end, 'MI') - 540 as minutes
from ETL_PROGRAM_log, ETL_PROGRAM
where ETL_PROGRAM_log.program_id = ETL_PROGRAM.program_id
and ETL_PROGRAM.program_name = 'END_CYCLE'
and to_char(ETL_PROGRAM_log.program_end, 'YYYYMM')='200401'
and to_char(ETL_PROGRAM_log.program_end, 'DY') != 'SAT'
and to_char(ETL_PROGRAM_log.program_end, 'DY') != 'SUN'
and to_char(ETL_PROGRAM_log.program_end, 'HH:MM') > '09:01'
And this is my Output
END_CYCLE, 2004-01--02-fre 00:59, -481
END_CYCLE, 2004-01--02-fre 12:31, 211
END_CYCLE, 2004-01--08-tor 09:00, 0
The first line should not be there, becouse it is only 00:59 witch is way before 9:00
And the last line should not either becourse it is at 09:00
Thanks
Larshg