How do you knock off bank holidays, saturdays and sundays for pay dates

Hi, there,
For simplicity, lets not go a far as bank holidays, at least I want to be able to run a job not using the DBMS.jobs package but on a trigger.
I want payments to go through at least on the 28th day of every month but it might fall on a weekend.
1* SELECT TO_CHAR(TRUNC(SYSDATE, 'MM')+27) FROM DUAL
SQL> /
TO_CHAR(T
28-APR-06
Do you think it can be done to push payment to the next working day if it falls on a weekend.
What do you think is best practise.
Contributions will be highly appreciated.
This is for learning purposes
cube60.

Hi Jameel and others,
I am trying to insert a paymentdate in a monthly_payment table, but would like it to fall on a work day and not a weekend.
Jameel's last post based on a CASE select statement was very useful in helping me out. I have been trying to transform that CASE statement into a function or a procedure. This function or procedure would be fired by a trigger when the date columns need to be filled when updating other columns in the same table using a call procedure.
More or less, this function is meant to fill in just a column in a row or rows of data when the other columns are about to be updated using another procedure.
Am i right with using a function in this situation?
see below for my errors:
SQL> create or replace function paymentdate
2 is
3 return v_date date;
4 Begin
5
6 select to_char(trunc(sysdate,'MM')+27,'Day') into v_date from dual;
7
8 if (v_date) ='sat' then
9 insert into contract_staff_pay (paymentdate) values (v_date + 2);
10 end if;
11
12 if (v_date) ='sun' then
13 insert into contract_staff_pay (paymentdate) values (v_date + 1);
14 else
15 insert into contract_staff_pay (paymentdate) values (v_date);
16 end if;
17 end;
18 /
Warning: Function created with compilation errors.
SQL> show err;
Errors for FUNCTION PAYMENTDATE:
LINE/COL ERROR
2/1 PLS-00103: Encountered the symbol "IS" when expecting one of the
following:
( return compress compiled wrapped
Many thanks in advance.
cube60

Similar Messages

  • ITunes U: how do I turn off the 50 MB download limit for mobile data connections?

    Since I rarely have access to Wi-Fi networks I do actually want to download iTunes U content using mobile data. Videos (and even some slide decks) exceed the 50 MB limit that iTunes U will allow you to download over mobile data connections. How do I turn off the 50 MB download limit for mobile data connections?

    You can't unless the phone is jailbroken (which in turn voids your warranty)

  • Identifying Saturday and Sunday from calender dates

    Hi all,
    i have a table with all the date of year from 200 to till date.
    now i want to identify all those dates from this table which are saturdays and sundays,
    how can i do this?
    please advice...
    thanks.

    Depends on what the nls_territory parameter is set to:
    alter session set nls_territory='UNITED KINGDOM';
    select to_char(sysdate, 'd', 'nls_date_language=american') monday,
           to_char(sysdate -1, 'd', 'nls_date_language=american') sunday
    from dual;
    M S
    1 7
    alter session set nls_territory='AMERICA'
    select to_char(sysdate, 'd', 'nls_date_language=american') monday,
           to_char(sysdate -1, 'd', 'nls_date_language=american') sunday
    from dual;
    M S
    2 1Edited by: Boneist on 06-Jul-2009 12:01
    BluShadow is too fast for me!

  • How do you exatly make java to 'sit' and listen for activities on a nokia..

    hi,
    is that possible? i mean in a general way, how you exatly make your app sit and listen without the user executing your app?
    like in windows's notification areas etc..,
    thanks,

    would be cool to run a j2me-appl in the background.
    but i doubt if that is possible at all.

  • Calculate the number of days in a year excluding Saturday and Sunday

    Hi All,
    I need to get the number of days in a year excluding Saturday and Sunday for HR module and then subtract the public holidays.
    Can some let me know how this needs to be done while loading data from one infocube to another.
    Is there any Function module for the same so that i can write any start routines.
    And also is there any table available for Tcode-SCAL with which i can write any start routines.
    Kindly help me as soon as possible.
    Regards,
    Kumar

    Hi Harish
    Refer to the screenshot for Import and Export parameters
    Code
    FUNCTION ZBI_FM_GET_HOLIDAYS .
    *"*"Local Interface:
    *"  IMPORTING
    *"    VALUE(DATE_FROM) TYPE  SCAL-DATE DEFAULT SY-DATUM
    *"    VALUE(DATE_TO) TYPE  SCAL-DATE DEFAULT SY-DATUM
    *"    VALUE(FACT_CAL) TYPE  SCAL-FCALID DEFAULT SPACE
    *"    VALUE(ONLYFACT_DAYS) TYPE  CHAR1 OPTIONAL
    *"  EXPORTING
    *"    REFERENCE(HOLIDAYS) TYPE  I
    *"  TABLES
    *"      DAY_ATTRIBUTES STRUCTURE  CASDAYATTR
    *"  EXCEPTIONS
    *"      FACTORY_CALENDAR_NOT_FOUND
    *"      HOLIDAY_CALENDAR_NOT_FOUND
    *"      DATE_HAS_INVALID_FORMAT
    *"      DATE_INCONSISTENCY
    DATA: LT_DAY_ATTRIBUTES TYPE TABLE OF  CASDAYATTR WITH HEADER LINE.
    DATA: LV_LINES TYPE SY-SUBRC.
    DATA: DATE1 LIKE DATE_FROM,
    DATE2 LIKE DATE_TO.
    *if from date is gt to date then interchange the dates and multiply the result with -1.
    IF DATE_FROM GT DATE_TO.
    DATE2 = DATE_FROM.
    DATE1 = DATE_TO.
    ELSE.
    DATE1 = DATE_FROM.
    DATE2 = DATE_TO.
    ENDIF.
    CALL FUNCTION 'DAY_ATTRIBUTES_GET'
    EXPORTING
    FACTORY_CALENDAR                = FACT_CAL
    *  HOLIDAY_CALENDAR                = ' '
    DATE_FROM                        = DATE1
    DATE_TO                          = DATE2
    LANGUAGE                        = SY-LANGU
    * IMPORTING
    *  YEAR_OF_VALID_FROM              =
    *  YEAR_OF_VALID_TO                =
    *  RETURNCODE                      =
    TABLES
    DAY_ATTRIBUTES                  = LT_DAY_ATTRIBUTES
    EXCEPTIONS
    FACTORY_CALENDAR_NOT_FOUND      = 1
    HOLIDAY_CALENDAR_NOT_FOUND      = 2
    DATE_HAS_INVALID_FORMAT          = 3
    DATE_INCONSISTENCY              = 4
    OTHERS                          = 5 .
    IF SY-SUBRC = 0.
    IF ONLYFACT_DAYS = 'X'.
    DELETE LT_DAY_ATTRIBUTES WHERE FREEDAY EQ SPACE.
    ELSE.
    DELETE LT_DAY_ATTRIBUTES WHERE WEEKDAY LT 6.
    ENDIF.
    DESCRIBE TABLE LT_DAY_ATTRIBUTES LINES LV_LINES.
    HOLIDAYS =  LV_LINES.
    *    IF DATE_FROM GT DATE_TO.
    *      HOLIDAYS = HOLIDAYS * -1.
    *    ENDIF.
    ELSEIF SY-SUBRC = 1.
    RAISE FACTORY_CALENDAR_NOT_FOUND.
    ELSEIF SY-SUBRC = 2.
    RAISE HOLIDAY_CALENDAR_NOT_FOUND.
    ELSEIF SY-SUBRC = 3.
    RAISE DATE_HAS_INVALID_FORMAT.
    ELSEIF SY-SUBRC = 4.
    RAISE DATE_INCONSISTENCY.
    ENDIF.
    ENDFUNCTION.

  • Billing date is for Monday for the orders created on Saturday and Sunday

    Hi Friends,
    I have an issue,that for the orders that are created on weekdays, the Billing date is for the same day.
    But for the orders that are created on Saturday and Sunday,the Billing date is being determined automatically for Monday.
    The goods are service material and ther is no delivery being created for these goods.Still the requested delivery date is being determined for Monday for the weekend orders.
    Any idea where i can check these settings or which program or userexit can be looked into for this.
    Thanks in advance...
    Sultan Khan

    Hi,
    How about using BBP_DOC_CHANGE_BADI ?
    Regards,
    Masa

  • Calender form - hiding weekends Saturday and Sunday

    I have a Calendar page and I want it to only show business days, hiding the weekends.  I found some code that halfway worked in this thread:
    https://forums.oracle.com/thread/684334
    But as it's old, I figured I would start another as the code isn't working entirely.  I placed it in the header region of the Calendar and it works when you initially open the page, but if you click the [Monthly] button, Saturday and Sunday re-appear until you refresh the page.
    <script type="text/javascript">
    //<![CDATA[
       $(document).ready(function(){
          $tblRows = $('table.t13Calendar tr');
          $tblRows.each(function() {
             $tblDatas = $(this).children('td, th');
             $tblDatas.eq(0).remove();
             $tblDatas.eq(6).remove();
    //]]>
    </script>

    When you click the buttons the Calendar code changes with a PPR (Partial Page Refresh) thus HTML is all new and different. The code only runs once (on document ready)
    So... add a Dynamic action that runs After Refresh of your region and runs the code (minus the script, the CDATA and the document .ready).
    $tblRows = $('table.t13Calendar tr');
    $tblRows.each(function() {
    $tblDatas = $(this).children('td, th');
    $tblDatas.eq(0).remove();
    $tblDatas.eq(6).remove();
    I'm surprised it works because it has the t13Calendar class in there, that's theme specific, you must be using the same theme.
    Thanks
    -Jorge
    http://rimblas.com/blog/

  • How will you turn off an IPhone 4S voice over with the latest IOS

    How will you turn off Voice Over in Iphone 4S? i tried turning it off through settings/accessability/voice over but when i turned it off it always go back to ON. It is very depressing to go over with this feature. Thanks.

    on your phone go to settings - icloud - find my iphone - off

  • HOW DO YOU TURN OFF "FIREFOX PREVENTED THIS PAGE FROM AUTOMATICALLY RELOADING". I did the "see Advanced - General - Accessiblity. and still having problems

    HOW DO YOU TURN OFF "FIREFOX PREVENTED THIS PAGE FROM AUTOMATICALLY RELOADING". I did perform the "see Advanced - General - Accessibility. It worked for me and my "user" site (don't know how to say my site) and still having problems with my wife's. I have gone to OPTIONS → GONE TO → ADVANCE and CLICKED THE LINE → ""Warn me when websites try to redirect or reload the page…""
    This did not rememdy the problem. I did try to get on the other site suggested
    http://kb.mozillazine.org/Accessibility.blockautorefresh
    but got a 404 error...
    I have googled the "ff prevented...." and after a number of hours searching I still have not found a fix...
    REALLY HOPE SOMEONE CAN HELP ME....
    JM

    You should still disable this setting:
    *Firefox > Options/Preferences > Advanced > General : Accessibility : [ ] "Warn me when web sites try to redirect or reload the page"
    The setting in "Options > Advanced > General" is meant as an accessibility feature, as you can see by the label of that section, so that people with disabilities or people who use screen readers do not get confused and is not meant as a safety protection to stop redirecting.
    What is the value of the <b>accessibility.blockautorefresh</b> pref on the <b>about:config</b> page?
    *http://kb.mozillazine.org/accessibility.blockautorefresh
    If you have problems with preferences, see:
    *http://kb.mozillazine.org/Preferences_not_saved
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem.
    *Switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance
    *Do NOT click the Reset button on the Safe Mode start window
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • How do you take off reseiving messages on multiple devices using the same apple account

    How do you take off reseiving messages on multiple devices using the same apple account?

    Go to Settings>Messages>Send and Receive on all but one device and add a unique email address on each device and delete the commone Apple ID email device
    If there is also an iPhone with iOS 6 associated with the Apple ID, uncheck the phone number on all but the phone.

  • How can you turn off the braille setting on an iPhone 4s, once on it won't let you slide the phone into use mode to change the settings or do anything?

    How can you turn off the braille setting on an iPhone 4s, once on it won't let you slide the phone into use mode to change the settings or do anything?

    An alternate method is Accessibility Settings when connected to iTunes. You should be able to turn it off there. I would also check out some of the answers listed to the right of this post and see if they can help.

  • Before I upgraded my iPad mini, you could turn off apps to save battery power by double clicking the control button and then holding your finger on the app button until the minus sign appeared.  That doesn't work anymore.  How do you turn off the apps wit

    Before I upgraded my iPad mini, you could turn off apps to save battery power by double clicking the control button and then holding your finger on the app button until the minus sign appeared.  That doesn't work anymore.  How do you turn off the apps with ios7

    Now you swipe downward, the app will appear and you delete, keep scolling to the right as in the past.  With the new operating system you also swipe downward to get the search bar to find an app

  • How do you turn off the auto select behavior when working with shape layers?

    How do you turn off the auto select behavior when working with shape layers?
    I am using either of the path selection tools to select only some of the paths on the layer. I have the proper layer targeted. I have the selection too auto select option turned off.
    If another layer has a path in that area, that layer becomes auto targeted and I get the wrong path. Turning off the layer is the only way to avoid this but then I have to  turn on the layer back on between making my selection and transforming to use the other layer as guide. Is there any way to stop this auto select? Locking the other layer does not stop the auto select, just prevents editing.

    As far as i know the move tool options don't have any effect on the path selection tools.
    You might try clicking on one of the path points or on the path itself with one of path selection tools and if you want to select multiple points
    you can shift click with the Direct Selection Tool or Alt click to select the entire path.
    more path shortcuts:
    http://help.adobe.com/en_US/photoshop/cs/using/WSDA7A5830-33A2-4fde-AD86-AD9873DF9FB7a.htm l
    http://help.adobe.com/en_US/photoshop/cs/using/WSfd1234e1c4b69f30ea53e41001031ab64-7391a.h tml

  • How do you turn off the pop up blocker

    How do you turn off the pop up blocker

    Hello karenlenore. You can turn on your pop-up blocker by following the instructions at this link. Let me know if this assists you or not. I'm only here to help!
    http://support.microsoft.com/kb/909604
    Mario

  • How do you turn off the Mac book pro monitor when using dual monitors?

    How do you turn off the monitor on the mac book pro and only see your second monitor?

    You close the lid and run in "clam-shell" mode
    http://support.apple.com/kb/HT3131?viewlocale=en_US

Maybe you are looking for