In pseudo-Oracle, I want to do the following:
select systimestamp + to_interval(select NUMERIC_COLUMN from SOME_TABLE where SOME_TABLE_PK = :stuff) from dual;
If the number of minutes were always the same, I could use an interval literal a la interval '360' minute
, but I can't find a simple function to convert a number to a MINUTE
interval. What am I missing?
To convert hours and minutes to a numeric number of Minutes: 1. Ensure the time to be converted is in the custom format hh:mm. 2. Ensure the cells where the answer is to be are formatted as a Number with 0 decimal points 3. In the cell where you want the answer enter the time cell number*1440 e.g =a2*1440
If you want to convert a number to time values, you need some additional operations, multiplying and dividing between days, hours, minutes, and seconds.
Excel stores Date and Time in number format. To convert hours from one standard time format to others, we can use the CONVERT Function. CONVERT function converts a number from one measurement system to another.
Ensure the time to be converted is in the custom format hh:mm. 2. Ensure the cells where the answer is to be are formatted as a Number with 0 decimal points 3. In the cell where you want the answer enter the time cell number*1440 e.g =a2*1440 4.
You can use the numtodsinterval function which does exactly the conversion you need (number to interval):
SQL> select systimestamp, systimestamp + numtodsinterval(20, 'MINUTE') from dual;
SYSTIMESTAMP SYSTIMESTAMP+NUMTODSINTERVAL(2
------------------------- -------------------------------
2011-08-22 16:12:24.060 2011-08-22 16:32:24.060
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With