Minutes and hours query problem

I've got the following query in my app:
SELECT NAME,
SUM(HOURS)+SUM(MINUTES/60)-SUBSTR(TO_CHAR((SUM(MINUTES/60)),'9999D00'),6,3) AS"HOURS",
MOD(SUM(MINUTES),60) AS"MINUTES",
SUM(OVERTIME_HOURS)+SUM((OVERTIME_MINUTES/60))-SUBSTR(TO_CHAR(SUM((OVERTIME_MINUTES/60)),'9999D00'),6,3) AS"OT HOURS",
MOD(SUM(OVERTIME_MINUTES),60) AS"OT MINUTES",
SUM (STAT) AS "STAT",
SUM(HOURS + (MINUTES/60) + (OVERTIME_HOURS*1.5) + ((OVERTIME_MINUTES/60)*1.5) + STAT)-SUBSTR(TO_CHAR(SUM((MINUTES/60)+((OVERTIME_MINUTES/60)*1.5)),'9999D00'),6,3) AS "TOTAL HOURS",
MOD(SUM(MINUTES+(OVERTIME_MINUTES*1.5)),60) AS"TOTAL MINUTES"
FROM KTT_INFORMATION
WHERE DAY BETWEEN (:P15_FROM_DATE) AND (:P15_TO_DATE)
GROUP BY NAME
I want the hours and minutes to display as hours in one column and the remaining minutes in the next column. The minutes are only 15,30 or 45 in the table. For some reason one of the hours columns is giving an output with a decimal. Where the output should be 191 hours and 45 minutes I'm getting 191.5 hours and 15 minutes.
Any ideas?

create or replace function get_time(p_time number)
return varchar2
is
v_time varchar2(20);
begin
v_time:=to_char(trunc(mod(p_time,3600)/60), 'FM00') || ':' || to_char(mod(p_time,60), 'FM00');
return (v_time);
exception
when others then
return null;
end get_time;
show errors;
i created a function which converts given minutes into hrs and min.
then i created a tem table and trying to insert hrs into one column and min into anothere column.
CREATE TABLE TEMP
TIME NUMBER(3) NOT NULL,
HRS NUMBER(3) NOT NULL,
MIN NUMBER(3) NOT NULL
insert into temp values (150,substr(get_time(150),1,2) ,substr(get_time(150),4,5))
hope this may be helpful to you.
sudhir.

Similar Messages

  • Making me older by about 20 Minutes and Hour!!!

    Strange, But true. My 10.4.8 install has got me gaining about 20 minutes every hour.
    I know this is not a battery problem. I have set up my machine to boot windows too and when it's in windows the time is fine. When booted into Tiger, after the initial NTP the machine starts gaining about 20 minutes to the hour.
    Strange problem - Any body getting old too?? Any solutions to slow down this aging problem??
    IMAC core Duo   Mac OS X (10.4.8)  

    RajivS
    Welcome to Apple Discussions!!
    after the initial NTP the machine starts gaining about 20 minutes to the hour.See if this topic from a few months ago gives you some clues:
    http://discussions.apple.com/thread.jspa?threadID=415080&start=0&tstart=0
    Try some of the things there, then post back.

  • Hi, my iphone 4 has diaplay priblems. that is once in a while the display gets distorted, fuzzy or in other words blurry. it happens with all the applications. even after eastrting the phone it works fine for few minutes and again the problem reappears.

    please help me fix the problem with my iphone 4. the display becomes distorted, fuzzy and blurry once in a while. i have no idea whi this is happening. how can i fix my phone?

    Try This...
    Close All Open Apps... Sign Out of your Account... Perform a Reset... Try again...
    Reset  ( No Data will be Lost )
    Press and hold the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears. Release the Buttons.
    http://support.apple.com/kb/ht1430
    Also consider Deleting any Apps you have Purchased / Downloaded but you now never use..
    If necessary...
    Connect to iTunes on the computer you usually Sync with and “ Restore “...
    http://support.apple.com/kb/HT1414

  • So after updating my ipod touch 3rd gen to 4.3.1 i noticed a lag everytime i turn it back on. it stays on the lock screen for minutes sometimes hours. the screen is usually unresponsive the only things usually changing are the time and battery percentage.

    so aafter upsating my touch to 4.3.1 i have noticed everytime i restart the ipod there is a huge lag at the lock screen. the screen only updates itself every three to five minutes only updating the time and battery status. i cannot do anything, usually it will stay like this for minutes sometimes hours. i have tried restoring it and thought updating will fix the problem but it hasn't yet. i currently have ios 4.3.3. recently i had a friend look into the ipod and he told me on a folder called damaged files he found this, 37c3ad com.apple.autowake.plist. how can i fix this?

    Try a manual install following directions in link below.
    Basic troubleshooting steps. 
    17" 2.2GHz i7 Quad-Core MacBook Pro  8G RAM  750G HD  120G Vertex 3 SSD Boot HD  

  • Performance Problems on Faces Navigation Diagram and Hyperthreading query

    Am I the only one having performance problems when dealing with Faces-Config Diagrams of about 35 JSPs displayed on the sheet. using Jdev 10.1.3 It's taking my workstation about a full minute and a half to update the name of an arrow. The most stressed component during this task seems to be the CPU.
    And just another question has anybody investigated how is the performance of Jdev affected by either enabling or disabling hyperthreading? In my case my CPU usage manages to reach only 50%. I'm tempted to switch HT off to let JDev use all the cpu power. if that would be the case.

    Hello Diego,
    you mentioned that you compared a BEx Query with the Web INtelligence report. Could you provide more details here ?
    - what are the elements in the rows, columns and free characterisitcs in the BEx Query ?
    - was the query execute as designed in the BEx Query Designer with BEx Web Reporting ?
    - what are the elements in the WebIntelligence Query panel ?
    thanks
    Ingo

  • How do I log the time in hours, minutes and seconds to a table

    Hi
    I'm a relatively new user of Labview. I am currently writing a program that logs the temperature of an oven and the current time to a table and graph. I am using a GPIB card to communicate with the oven. I have used the Get Date/Time string to get the time and the Decimal String to Number to convert the time to a number which I have then put into an array which goes to a table and graph. My problem at the moment is that the time is being logged in hours only. I need to log the time in hours, minutes and seconds. Can you tell me how I can do this?

    Hi,
    I can see the setup now. The decimal string to number will only ever give the hours, since the ':' character is not part of a number, so won't translate. Use the code I attached previously to get the time as a timestamp, and then go from there.
    I've made some modifications, although you'll need to alter the file save to take into account the double precision number
    for the timestamp is now 3E+9 (since it's seconds since 1904!!), but since you're writing to a comma separated values (or tab deliminated) style file, this shouldn't be a problem. You could always do a textual save from the table instead.
    Thanks
    Sacha Emery
    National Instruments (UK)
    // it takes almost no time to rate an answer
    Attachments:
    temp time program.vi ‏98 KB

  • I can start my iPod but it will only stay on the Apple icon screen for 5 minutes and then shuts off, what do I do to fix this problem?

    I can start my iPod but it will only stay on the Apple icon screen for 5 minutes and then shuts off, what do I do to fix this problem?

    Try:
    - iOS: Not responding or does not turn on
    - Also try DFU mode after try recovery mode
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    - If not successful and you can't fully turn the iOS device fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - If still not successful that indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.
    Apple Retail Store - Genius Bar

  • Regarding function module to convert hours to minutes and seconds to minute

    hi all,
        is there any function module to convert hours to minutes and seconds to minutes....if so please guided me....i hav req like this...want to convert all those to minutes[seconds and hours]....

    Hi,
    Use FM
    SD_CALC_DURATION_FROM_DATETIME
    Pass paramters like
    I_DATE1 16.09.2008
    I_TIME1 10:33:00
    I_DATE2 16.09.2008
    I_TIME2 19:00:00
    and you will get the result as below..
    E_TDIFF 8:27
    8 hours and 27 minutes...
    Now u can use this values of hours and minutes to get the exact wage type values... get the details from HR module and multiply it with the hours and minute and calculate it...
    Use Offsets and get the hour and minute value from E_TDIFF
    Hope it will solve your problem..
    Thanks & Regards,
    Naresh

  • Problem with my touch screen. It works for 1 or 2 minutes and then it doesn't work for 2 or 3 minutes !!

    hi everybody
    I have a problem with my touch screen. It works for 1 or 2 minutes and then it stops working for 2 or 3 minutes, this is a loop ! if I don't use for a couple of hours it will work more, about 15 minutes and then stops working !!! whats wrong with may iphone, which part is damaged ?:(
    ( when touch screen stops working, all keys work correctly, home key & others )
    please help me

    oh
    finally problem solved
    the finger touch part was damaged, they replaced it with a new one and now I have my iphone 4g as it was at first, brilliant like always

  • Can edit event title, day, and hour, but *not* minutes - Help!

    I can edit everything about my calendar event title, day, and hour, but not the minutes. This is very annoying and I'm not able to have accurate calendar entries.
    It's like there' s a glitch in the program. Can it be reloaded/rebooted?
    Using iCal 3.0.8

    I have the exact same problem, and it is really driving me crazy...
    Any luck with it??

  • SharePoint DateTime Control "Hour, Minute, and Second parameters describe an un-representable DateTime"

    I am facing a strange behavior from SharePoint:DateTime control.
    I have a webpart containing couple of fields along with datetime control. If I leave this page inactive for a while and then click submit, an exception is thrown stating that "Hour, Minute, and Second parameters describe an un-representable DateTime". 

    Hi,
    According to your post, my understanding is that you got datetime control error.
    The problem may be lied in the Time component. You can disable the time component and go for a date only rendering of the control by setting
    DateTimeField.DateOnly = true.
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/64c05363-fd7e-49bb-8239-c93ec78172b6/datetime-control-using-basefieldcontrol?forum=sharepointgeneralprevious
    what’s  more, you can the ULS log to see the details errors.
    For SharePoint 2013, by default, ULS log is at
    C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\LOGS
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • How can I change the timer in the clock app to minutes and seconds instead of hours and minutes?

    Is it wishful thinking or a false memory? It seems like there used to be a way to change the timer function of the clock from hours and minutes to minutes and seconds. I feel like there's a magic tap or secret swipe that I discovered but have forgotten.  Am I totally delusional?

    We may have to wait for an update.  Aside from changing the country, I'm not sucre this can be done.  There is no Health App in the System preferences and no  way to modify from within the app.  Weird.
    If you go to Language & Region under general settings and choose any other country, you will get Metric.  I have the opposite problem.  I live in a Metric country and want my health app to be in lbs and inches which is what I am used to.

  • I have a late 2012 iMac running osx 10.8.5.  I keep losing access to my internal hard drive.  I can reboot and regain access and it will last for a few minutes or hours.  Disk utility does not seems to help.

    I have a late 2012 iMac with an I5 precessor running OSX 10.8.5 and a 1tb internal hard drive.  I keep losing access to the internal hard drive/startup disk.
    I can reboot and everything operates as normal for a few minutes or hours but then I lose all access again to anything on the hard drive.  The computer is still up and running but no files can be accessed and certain websites cannot be acessed even though internet access appears to be normal.  Disk utility can only find permission errors related to iTunes which can be repaired only to come back at the next scan (I would not think permission errors would have anything to do with the hard drive crashing).  It does not seem to matter what program I am using at the time access is lost and it can lose access sometimes right after reboot when no program is running.

    You will need to boot into the Recovery Volume (command - R on a restart or hold down the option/alt key during restart and select it) to run Disk Utility/Disk Repair.

  • After clicking "yes" to the question "do you want to update itunes now", i waited 2 hours and 15 minutes and it was still "loading".  i turned computer off thinking something was wrong.  now itunes won't open at all.  do i need to download itunes again?

    after clicking "yes" to the question "do you want to update itunes now", i waited 2 hours and 15 minutes and it was still "loading".  i turned computer off thinking something was wrong.  now itunes won't open at all.  do i need to download itunes again?

    Did you actually download the installer from Apple or did you use Software Update.  You can download the installer http://www.apple.com/itunes/download/
    Maybe I'm old fashioned but I would consider repairing permissions first using Disk Utility because something caused this to go wrong the first time.  And of course make a backup of your whole library first.  It shouldn't happen but some have complained about their libraries being wiped out by iTunes updates.  Better safe...

  • Hello , please am having a problem with my iphone 5 , the battery runs out quickly , also if i turn on 3G it will run faster , 15 minutes and the iphone battery will be out , and my final problem is that is "no service " appears a lot can you help ?

    Hello , please am having a problem with my iphone 5 , the battery runs out quickly ,another problem also if i turn on 3G it will run faster , 15 minutes and the iphone battery will be out . My final problem is that  "no service " appears a lot  especially when opening wifi or 3G , can you help ?

    Your battery is running quickly because your cellular data connection is weak.
    Is your phone carrier a supported carrier:   Wireless carrier support and features for iPhone in the United States and Canada - Apple Support
    For your no service issues:  If you see No Service in the status bar of your iPhone or iPad - Apple Support

Maybe you are looking for

  • DTR workspace is not modifiable-not able to EDIT track DC- in NWDS.

    Hi, i am not able to EDIT in my project that i creted from ESS track of NWDI. i am getting the following error:- Checkout is not possible. See below for details. Component com.sap.xss.hr.per.us.bank.cc.CcPerBank ======>problem: DTR workspace is not m

  • Regarding Visual voice mail

    Hi All, Can anyone expalin me what is visual voice mail? How it works? Iwant to implement this feature so how should i proceed for this? regards Anil R

  • Game program in JSP

    Hi, I wish to do a simple online poker game in java. Shall I write the code throgh socket programming? Is there any need to create a server through socket?(becuase I wish to implement this on a remote host). If I create a server, How will I run it re

  • RV016 port forwarding by WAN port?

    Hi, I am replacing an ancient SOHO 90 series router with our new RV016, I was told this thing would do everything we needed which I didn't doubt, however, I am wondering if I made the wrong choice now.  We have 5 IP's on one line coming into the curr

  • Flash 10.1 on the n900 , and how to get it ( andro...

    here it is http://www.youtube.com/watch?v=mad11TrKQXM&NR=1 running on a not overclocked phone, this video shows the android 2.2 froyo on the n900 with FULL FLASH 10.1 , and here is how to get the andoid 2.2 froyo in dual boot mode with flash 10.1 htt