'Generate all the dates + hours between two dates' was answered.
nor azan Ab Aziz, March 13, 2019 - 7:17 am UTC
Thank you... my question was answered.
nor azan Ab Aziz, March 13, 2019 - 7:47 am UTC
Hi Chris,
How to get output like this:
DT
03-JAN-2019 22:00:00
03-JAN-2019 23:00:00
04-JAN-2019 00:00:00 --> Suppose to 03-JAN-2019 23:59:00
Means date still same day but the time for midnight I wanto to use 23:59
March 13, 2019 - 11:11 am UTC
Then you need to subtract one second (1/86400) from the final row in the result set.
Get the final row in the result set
nor azan Ab Aziz, March 14, 2019 - 4:59 am UTC
Hi, could you help me how to get the every 24th rows and make the time 23:59?
Thank you.
March 14, 2019 - 8:39 am UTC
See below.
avoiding the were-car
Racer I., March 14, 2019 - 8:23 am UTC
Hi,
select trunc(sysdate) - 2 + (level / 24) - CASE level WHEN 24 THEN 1/86400 ELSE 0 END dt
from dual
connect by level <= (24 + (24 * (trunc(SYSDATE) - trunc(SYSDATE) + 2)));
regards,
...forever
Racer I., March 14, 2019 - 8:24 am UTC
select trunc(sysdate) - 2 + (level / 24) - CASE MOD(level, 24) WHEN 0 THEN 1/86400 ELSE 0 END dt
from dual
connect by level <= (24 + (24 * (trunc(SYSDATE) - trunc(SYSDATE) + 2)));
March 14, 2019 - 8:41 am UTC
Nice stuff, thanks.