Good afternoon.
I have a field in my database, which is an integer that records time / minutes. Someone knows how I could convert this whole for hours / minutes (in 24h format).
I have a field, for example that it records the number 782, which actually represents within the system the hour 13:02.
If someone has any idea, or have already worked with whole conversion to time / minutes, thank you.
Thanks.
Whole convert in hours / minutes
-
- Moderador
- Posts: 641
- Joined: Mon, 03 Sep 2007 3:26 pm
- Location: Fortaleza - CE
att,
Daniel N.N.
Daniel N.N.
In fact your data record stores the number of minutes that for reporting reasons you intend to display.
The following function has this purpose. I hope you answer.
The following function has this purpose. I hope you answer.
CREATE OR REPLACE FUNCTION get_hours_from_min_f
(
p_minutes NUMBER
) RETURN VARCHAR2 IS
ln_hours NUMBER;
ln_minutes NUMBER;
lv_return VARCHAR2(10);
BEGIN
ln_hours := TRUNC(p_minutes/60);
ln_minutes := MOD(p_minutes,60);
lv_return := ln_hours || ':' || LPAD(ln_minutes,2,'0');
RETURN lv_return;
END;
-
- Information
-
Who is online
Users browsing this forum: No registered users and 36 guests