How to calculate business hours, after hours...

Hello,
I need to break down the time interval between 2 dates into:
- business hours (9-5)
- after hours
- weekends
- holidays
the time interval between 2 dates
Any hint/pointer/url to a known solution/procedure/generic algorithm would be greatly appreciated...
I need/prefer to do the calc in Forms program unit (PL/SQL).
Thanks/
Regards,
Arpad

See this:
http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:185012348071
Tom Best

Similar Messages

  • How to calculate the hour difference between two dates?

    hi all,
    how to calculate the hour difference between two dates?
    eg i trying this...
    ((TO_DATE(TO_CHAR(GRNi.reference_date_4,'hh24:mi'),'hh24:mi') -
    TO_DATE(TO_CHAR(NVL(GRNi.reference_date_3,SYSDATE),'hh24:mi'),'hh24:mi'))*24)*60 Act_Hr
    Reg.
    AAK

    Hi
    To break the diff between 2 dates into days, hours, minutes, sec -- you can use the following:
    select to_char( created, 'dd-mon-yyyy hh24:mi:ss' ),
    trunc( sysdate-created ) "Dy",
    trunc( mod( (sysdate-created)*24, 24 ) ) "Hr",
    trunc( mod( (sysdate-created)*24*60, 60 ) ) "Mi",
    trunc( mod( (sysdate-created)*24*60*60, 60 ) ) "Sec",
    to_char( sysdate, 'dd-mon-yyyy hh24:mi:ss' ),
    sysdate-created "Tdy",
    (sysdate-created)*24 "Thr",
    (sysdate-created)*24*60 "Tmi",
    (sysdate-created)*24*60*60 "Tsec"
    from all_users
    where rownum < 50
    HTH
    RangaReddy

  • How to set Business Hours with script?

    I have a single SCCM 2012 SP1 CU4 server running on Windows Server 2012.
    My business has multiple locations and some of them have different hours of operation.  I am wanting to change the "Business Hours" for some of these sites and looking for the best way to do it.
    I found this guide that uses PowerShell, but I get a "Script is not signed" error:
    http://powersheller.wordpress.com/2012/11/20/sccm-2012-setting-software-center-business-hours-with-a-compliance-configuration-item/
    I saw Torsten's example using a VBscript, but I get an "Incorrect function" error:
    http://www.mssccmfaq.de/2012/03/26/software-center-business-hours-auslesen-setzen/
    Both of those web pages look like they were done a couple years ago so I hope everything still applies.
    Any help would be great!
    Thanks

    For the Powershell one... make sure you have two things. In the ConfigItem, for the Compliance test, you did check the box about "run the specified remediate script ..." right?
    for the Baseline, when you assigned it, you did check the box about remediate when you deployed it to the collection?
    If either or both of those are missing, what you are doing is monitor only... so the remediation script won't ever actually run, so it's monitoring only.  So it would make sense that you are getting non-compliants back.  You aren't ever asking
    it to really run the remediation piece.
    EDIT:  Just referencing this here... just in case: 
    http://blogs.technet.com/b/server-cloud/archive/2012/03/28/business-hours-vs-maintenance-windows-with-system-center-2012-configuration-manager.aspx  Sometimes people misunderstand what a business hours definition means vs. what a Maintenance Window
    (Service Window) means in Configmgr 2012.  If you aren't 100% positive what the difference is, read through that blog just to get it straight.
    Standardize. Simplify. Automate.

  • How to calculate the coordinate after implementing Affine Transformation?

    Hi, guys!!
    I am working on a Map makeing program, like MS Visio. Then, I need to put an icon on the working space. And the icon can be moved, rotated, and scaled, when mouse drags handles (8 small circles) around the icon. However, the problem is that after the icon is scaled or rotated using AffineTransform class, I do not know how to calculate the coordinate to paint the mouse handles.
    Please give me your suggestions!! Thanks in advance!!

    Sure. The idea is that you track your translations, scaling, and rotation separate from the AffineTransform. That way, you know what you need to revert:
    AffineTransform at = new AffineTransform();
    at.translate(20, 20);
    at.scale(2, 2);
    at.rotate(45, 10, 10);
    At this point, let's assume you want to translate again. First you have revert the rotation and the scale:
    at.rotate(-45, 10, 10);
    at.scale(1/2, 1/2);
    at.translate(10, 10);
    In order to do this, you need to track your scaling and rotation values when you change them. If this isn't feasible, it's certainly possible to derive the values from the AffineTransform, but that's a bit tougher.
    Michael

  • How to calculate Residual hours without running Carry Over

    Hello Friends..
    Here comes the scenario,
    I need to pay the employee on the last pay period of the year for the sick leave accrued beyond carry over.
    but client will run the carryover only on the first day of the new year..
    how could i Calculate the residual hours without running the carryover??
    Guru

    Hi Guru,
    Don't you think it will be risky paying the employee in the last pay period before the carryover process? there can be a scenario where you have paid the employee and the employee also applies leave before the carryover process.
    It is always recommended that you define the cut-off period beyond which employees are not able to apply leave for current calendar year and then get the excess leave for payout and then run the carryover process.
    Just give a thought on this and recommend the same to the client.
    Thanks,
    Sanjay

  • How to Calculate End-Date for a given Startdate in business hours without holidays

    Hello Experts,
    I need to create a plsql function where we need to determine end date for a task. For this, input will be only start date & number of hours allocated for that task. Based on this input we need to exclude Business hours & need to include only Business hours. and in the end we need to achieve the end date after the hour addition to the start date.
    Example : INPUT: 03-OCT-2013 12:00:00 PM /
                                  Hours Allocated 30 Hrs.
    Business Hours - 11 AM to 9 PM.
    So time starts from or Startdate is Friday 03-OCT-2013 12:00:00 PM. 
    So If I want to calculate the end-date by adding 30 hours to it, it should come WednesDay 09-OCT-2013 12:00:00 PM because I excluded Weekends & considered only business hours that is 11 am to 9 pm.
    I am not able to get any such guidance in Internet as most of the docs are having start & end date as input.
    Please help!
    Thanks in advance !!

    Hi,
    As Christ said, there's no nuilt-in Oracle function to tell whether a given DATE is a holiday or not, partially because there's so much local variation in holidays.  You can write a function like that (see http://forums.oracle.com/forums/message.jspa?messageID=3351081 ), but creating a table will be simpler and more efficient.
    I suggest creating a row for every date, whether it's a work day or not; that way, you can have variations in the schedule (e.g., schedule changes and
    partial holidays).
    CREATE TABLE  work_calendar
    (   dt  DATE       PRIMARY KEY
                       CONSTRAINT  work_calendar_dt
                           CHECK (dt = TRUNC (dt))
    ,   day_type       VARCHAR2 (8)  NOT NULL
                       CONSTRAINT  work_calendar_day_type
                           CHECK ( day_type IN ( 'HOLIDAY'
                                               , 'WEEKEND'
                                               , 'WORK DAY'
    ,   start_time     DATE
    ,   end_time       DATE
    ,   work_hours     NUMBER
    ,   work_hours_since_1970     -- or some point earlier than you'll ever need
                       NUMBER
    ,   CONSTRAINT  work_calendar_start_time
            CHECK ( TRUNC (start_time) = dt)
    ,   CONSTRAINT  work_calendar_end_time
            CHECK ( TRUNC (end_time) = dt)
    This will let you do a lot of the calculations you need without a function.

  • Restrict data to after Business hours only...

    hi all,
    I am trying to ascertain how many services calls are logged to a particular workgroup made after business hours i.e. after 6.00 pm(18:00hrs) and before 7am (07:00hrs), each day for past 2 months.
    so how do i restrict the data only between these times.
    i am confused as 7.00am fall on the next day early morning.??? thus data is restricted to from 6 in evening to 7:00 hrs next day in morning.
    any inputs or ideas will be highly appreciated mate..
    regards
    abhi.

    Use a record selection formula that ONLY pulls times (hopefully you have a date time field) that are between 6pm and midnight OR between midnight and 7am.

  • Shut down WLAN after business hours

    Hello,
    We have recently deployed a vWLAN controller (AIR-CTVM-K9) and AIR-CAP2602I-A-K9 access points at all our sites.  Since we are a retail operation I want to make the WLAN unavailable after business hours.  The Cisco sales promo material mentions this as a capability but I can't find any supporting documentation.
    How would I set this up?

    There are several methods to achieve this and this depends on how your network is setup and how much technical skills you have:
    1.  MS AD:  You can specify time and dates when authentication happens;
    2.  Cisco EnergyWise:  You can specify what time of day(s) to enable the Cisco switch to provide PoE to the AP.  When specified, the switch will disable power to the port.
    3.  You can enable time-based ACL to disable the dynamic interface of your AP.  Your AP will still be able to broadcast the SSID but it will NOT accept any clients (or the clients will get 169.X.X.X IP addresses).
    Finally,
    4.  If you have WCS/NCS or Prime Infrastructure, you can specify the time and date when the radio of the APs go up or down.

  • How can i calculate overtime hours with PCR?

    hi all,
    i was wandering, can i calculate overtime hours in this case?
    example my DWS for this day is 08.00 - 16.00
    i do early overtime from 06.00 - 08.00, and after my working hours is finished, i do late overtime from 16.00 - 19.00
    (in TIP it is separated in 2 rows)
    how can i calculate my total overtime with pcr? i want to use the total for another calculation..
    06.00 - 08.00 : 2 hours
    16.00 - 19.00 : 3 hours
    +
            total      : 5 hours.
    thx all..

    ZPRN    DVARSTPRSNT
    N      COLOP*
    Y     DOUTTPORIGS
    Y E  HRS=0     HRS=PNUM  ADDDB9066 COLOP*
    Y *  COLOP*
    THE ZPRN PCR WILL GET THE TOTAL NUMBER WORKING HRS IN TIME TYPE 9066
    Now we will write a pcr to get overtime details
          DVARSTDPRCL
    *    DVARSTHOLCL
    * 1  D HRS=D9066  HRS-S HRS?0
    * 1 * ADDDB9067
    * 1 < COLOP*
    0 *
    NOW THIS PCR WILL BRING THE OVERTIME
    BASED ON YOUR DAILY WORK SCHEDULES U NEED TO CHANGE VARSTDPRCL NOW MY RULES WILL WORK FOR ALL THE SHIFTS OTHER THAN WEEKLY OFFS
    REGARDS,
    RAJA SEKHAR.

  • I'm looking for a voicemail app that will automatically switch over after normal business hours and play an alternate voice-mail message. Does this currently exist?

    I’m looking for a voicemail app that will automatically switch over after normal business hours and play an alternate voice-mail message. Does this currently exist?

    Voicemail is through your carrier and on their equipment.
    It's function and features is set by them, not your phone.

  • Ports to shutdown after business hours

    what i am trying to accomplish here is to configure half a dozen ports on a 3550 cisco switch to automatically shut down after business hours. I would also like the port to automatically enable 5 minutes before business open. i cant find anything in cisco that would allow me to do this. please help or point me to a direction.

    Hello,
    have a look at the following documents:
    Schedule commands with Cisco IOS' kron
    http://techrepublic.com.com/5100-1035_11-5553313.html#
    Command Scheduler
    http://www.cisco.com/en/US/products/sw/iosswrel/ps5187/products_feature_guide09186a00801b0695.html
    I am not sure if this works on a 3550...
    Regards,
    GP

  • How do I get tech help for export pdf during Australian business hours?

    How do I get tech help for export pdf during Australian business hours?

    You can post your issues in this forum or send your questions to DL-exportpdf_feedback.
    Jyh-Jiun Liou

  • Is there apple support chat available after business hours

    I need to reset my security questions for iTunes because I forgot the answers and it is after business hours do I have to wait until morning
    to get help?

    many thanks.
    Downloading goes through the installation process, but then stalls with the message that "Apple Application Support" is missing.
    With the Error 2, let's try a standalone Apple Application Support install. It still might not install, but fingers crossed any error messages will give us a better idea of the underlying cause of the issue.
    Download and save a copy of the iTunesSetup.exe (or iTunes64setup.exe) installer file to your hard drive:
    http://www.apple.com/itunes/download/
    Download and install the free trial version of WinRAR:
    http://www.rarlab.com/download.htm
    Right-click the iTunesSetup.exe (or iTunes64Setup.exe), and select "Extract to iTunesSetup" (or "Extract to iTunes64Setup"). WinRAR will expand the contents of the file into a folder called "iTunesSetup" (or "iTunes64Setup").
    Go into the folder and doubleclick the AppleApplicationSupport.msi to do a standalone AAS install.
    Does it install properly for you?
    If instead you get an error message during the install, let us know what it says. (Precise text, please.)

  • Calculate time difference with respect to business hours

    Dear Experts,
    I have 2 group for which business hours is below,
    Group A      Sunday 6 PM till Fri 5.30 PM EST
    Group B      Monday to Friday, 3:30 AM to 5 PM EST
    I having below sample table with data,
    DECLARE @TBL_DATA TABLE(P_NUM INT, P_GROUP NVARCHAR(50), P_START_TIME DATETIME, P_END_TIME DATETIME)
    INSERT INTO @TBL_DATA VALUES(12, 'A', '2015-01-10 5:08:58.000', '2015-01-11 15:10:18.000')
    INSERT INTO @TBL_DATA VALUES(11, 'A', '2015-01-03 5:08:58.000', '2015-01-05 15:10:18.000')
    INSERT INTO @TBL_DATA VALUES(13, 'B', '2015-01-03 5:08:58.000', '2015-01-05 15:10:18.000')
    INSERT INTO @TBL_DATA VALUES(14, 'C', '2015-01-03 5:08:58.000', '2015-01-05 15:10:18.000')
    Here in above table, for P_NUM = 11, start time is Satarday 5.08 and this belong to group A, hence actual start time should be Sunday 6 PM and similarly for others.
    I am looking for a solution to calculate the time between start & end time with respected to business hours not on actual start date.
    Note - For some tickets I have start and end time within business hours, hence for those row I need staright way difference.
    Please suggest! Thanks

    Good day
    Yazdani ISTS,
    1. Did you checked
    giovhan's response?
    I don't see that you respond to his answer (or to Charlie Liao for that matter).
    2.  Is this still an issue?
    if not,
    please close the thread by marking the answer/s, and voting for useful responses.
    Thanks!
      Ronen Ariely
     [Personal Site]    [Blog]    [Facebook]

  • How to calculate the salary of the employees when they are differentiated by monthly and hourly basis

    Hi all
    How to calculate the salary of the employees when they are differentiated by monthly and hourly basis
    How can we write the logic though sql
    Thanks in advance

    (case when pay_basis like 'HOURLY'
    then PROPOSED_SALARY_N*pay_annualization_factor
    when pay_basis like 'ANNUAL'
    then PROPOSED_SALARY_N*pay_annualization_factor
    end )
    I was actually trying to write the logic in this way but it was not calculating in correct format for hourly paid employees

Maybe you are looking for

  • How to trace sevice names used in oracle names server

    We are in process of cleaning up our oracle names server (9.2.0.6). In process, we found several fault entries (service names) which we are not sure of.. ( as it is a large nework) but we need to fix them. For ex. abc. world may be pointing to a db s

  • Automator PDF to Images

    I have a bunch of pdfs they need to be splitted. So far the action PDF to Images works but it is saving all PDFs to the Desktop instead of the chosen folder. I saved this as an application but when I run it again it defaults back save output to: Desk

  • Migration to mac from linux

    I've been a linux user since 1998. I think I'm done. Weighing all the options I really think I'm headed for a Mac Mini. I'm waiting for the Haswell refresh and I have a friend who works for Apple who is going to help me out with the Friends and Famil

  • No surround sound on DTT2500 with X-FI music card

    Hi, I have new x-fi music soundcard and my old Cambridge Soundworks DTT2500 System. When I set the speakermode of the x-fi to 5.1 speakers it doesn't work correctly. The speaker test for the rear speakers is only audible on the left and right speaker

  • Time Machine backup disk - accidentally selected Do Not Use

    I had an issue I was trying to correct- I selected the backup volume, to which I had previously backed up to, and choose "Do Not Use."  Now, when I choose the "browse other backups" option from the Time Machine menu, it does not show the original bac