Current Quarter & Semi Annual Start Dates

Hi,
Generally financial year end will be 31st Dec. I have a situation where financial year end can be last day of any of the 12 months in a year. So based on that the quarter start dates, semi annual start dates vary.
Example: Financial Year End Date is 31-AUG-2008
Quarters
01-Sep-2007 to 30-Nov-2007
01-Dec-2007 to 29-Feb-2008
01-Mar-2008 to 31-May-2008
01-Jun-2008 to 31-Aug-2008
Semi Annual Start Dates
01-Sep-2007
01-Mar-2008
I have the following query to find the Quarter Start Dates no matter what month does the financial year end falls in
SELECT ADD_MONTHS (TRUNC (SYSDATE, 'MM'),
                     MOD (TO_CHAR (TO_DATE (<current fiscal year end>, 'DD-MON-YYYY'),
                                   'MM'
                          3
                   - 2
  FROM DUAL;
Example:
SELECT ADD_MONTHS (TRUNC (SYSDATE, 'MM'),
                     MOD (TO_CHAR (TO_DATE ('31-AUG-2008', 'DD-MON-YYYY'),
                                   'MM'
                          3
                   - 2
  FROM DUAL;
ADD_MONTHS(
01-MAR-2008Likewise I am trying to write a query to find the Semi Annual Start Dates. Can any one help me with this.
Thanks

Pratz, I have the following solution similar to yours.
create or replace function semi_annual_start_date(
     curr_fiscal_year_end DATE
     RETURN DATE
IS
     p_date DATE := NULL;
BEGIN
     p_date := ADD_MONTHS (curr_fiscal_year_end, -6);
     IF sysdate > p_date
     THEN
        RETURN (p_date + 1);
     ELSE
        RETURN (ADD_MONTHS(curr_fiscal_year_end, -12) + 1);
     END IF;
END;
/I am trying to implement this in a single SELECT query (if possible) something similar to the Quarter Start Date Solution given in my last post.
Can you help me in achieving this. Thanks for the help.

Similar Messages

  • Calculation of start date with backward scheduling

    Dear all,
    I am facing an issue related to backward scheduling. I have requirement in which whenever backward scheduling is used, system should calculate from last activity to first for calculation of schedules which is fine. But when running scheduling i am giving finish date as input and system is always using start date as current date and not calculation last date from last. For example if i input finish date as 15 feb 2015, and there is only one activity of 15 days, system should count start date from 1 feb 2015. Please help me how i can achieve this, currently its always putting start date as current date.
    My current settings are--
    Project definition-  WBS Scheduling profile-  Backward scheduling
                                  scheduling scenario-  Free scheduling
    Network-      Planning type- basic dates
                        Scheduling type- Backward
    Please help.
    Thanks

    Dear all, this issue is resloved. Reason was that by default i am using forward scheduling for all project but in case of backward scheduling, user change schedule type at project definition and network. I was removing start date and putting finish date and running scheduling. Missing step from my side was i need to first copy date from top to down than run scheduling again.
    Thanks.

  • How to get Current Quarter and Fiscal Quarter for a Date - Fiscal Year starts from 1st April

    Hi, 
    I need to calculate current quarter and fiscal quarter in my Sql query.
    I have a column for DateTime Datatype. 
    I need to find out Current Quarter Name like Q12012, Q22012, Q32012, Q42012 and Fiscal Quarter Name as well.
    Now Fiacal Year starts from 1st April, and Current Quarter starts from 1st Jan.
    For Current Quarter of 2012
    Jan-Mar = Q12012
    Apr-Jun = Q22012
    Jul-Sep = Q32012
    Oct-Dec = Q42012
    For Fiscal Quarter of 2012 ( starts from 1st Apr, 2011 )
    Apr2011-Jun2011 = Q12012
    Jul2011-Sep2011 = Q22012
    Oct2011-Dec2011 = Q32012
    Jan2011-Mar2012 = Q42012
    means if its 1st April, 2012,
    its a new Fiacal Year 2013 so Fiacal Quarter Name should be Q12013
    and its Current Quarter Name should be Q22012
    Can you help me to calculate this in a select query for given dates?
    Thanks in advance, 
    Nirav

    This should do it..
    Select
    FORMAT(datepart(quarter,getdate()),'Q#')+FORMAT(getdate(),'yyyy')

  • Query to find the start and end date of current quarter

    I want a query to give me the start date and end date of current quarter
    I don't want to use TRUNC and ROUND as the 16th day roundoff logic is not required.
    Thanks in advance.

    Hi ,
    I'm quite sure that the year quarters are static.....
    So , you can save them as records of a table , such as:
    QRTY START_DAY END DAY
    ============================
    1 1/1 30/3
    2 1/4 30/6
    3 1/7 30/9
    4 1/10 31/12
    The sysdate(day of the current quarter) must be between a start_day and appropriate end_day of the quarters, concatenated with the sysyear (year of the sysdate).
    So , if the above table is called Quarters ...
    then
    select start_day , end_day
    from quarters
    where to_date(sysdate,'dd/mm/rrrr') between (to_date(trim((start_day||'/'||to_char(sysdate,'rrrr'))),'dd/mm/rrrr'))
    and (to_date(trim((end_day||'/'||to_char(sysdate,'rrrr'))),'dd/mm/rrrr'));
    [b]Result
    START_DAY END_DAY
    1/10 31/12
    Regards,
    Simon
    Message was edited by:
    sgalaxy
    Message was edited by:
    sgalaxy

  • Payroll scheme - quarter and semi-annual payments

    Hi.
    I have the following questions concerning Payroll scheme I am working on.
    How can I check the following conditions?
    1. A wage type (WT) for quarter payment has not to be paid to a worker if he was hired during the last month of a quarter. For example, a worker was hired in September 01, 2011 - thus, in September a WT shouldn't be paid to him, 'cause September is the last month of a 3rd quarter.
    2. Another WT for semi-annual payment has not to be payed to a worker if he has been hired during the last 2 months of a half year period. For example, the worker was hired in November 01, 2011 - thus, in November and December a WT for semi-annual payment shoudn't be paid to him.
    Please, give me any tips to solve the issue, thank you.

    rkvarma,
    with which function will I be able to determine the months to start from?
    I want to make the following:
    - for quarter payments - to determine months 3, 6, 9, 12, and if employees were hired during these months, then the WT shouldn't be paid.
    - for semi-annual payments - to determine months 5,6 and 11,12, and if employees were hired during these months, then the WT shouldn't be paid.
    How to do this?

  • Date: showing the current quarter

    Hi,
    I want a field where you can chosse the current quarter. Is this possible? Has it something to do with date format? date.short, medium, long,...?
    Thanks in advance for helping me!
    Matthias

    First option:
    in Acrobat Pro I would write something like this (the "else" is still missing; second problem is that I can't make this for all years...)
    var 
    DatumsUhrzeitfeld4 = this.getAttribute("DatumsUhrzeitfeld4");
    if 
    (DatumsUhrzeitfeld4 = "August 2010"){DatumsUhrzeitfeld4
    = "Quartal 3"}
    if 
    (DatumsUhrzeitfeld4 = "September 2010"){DatumsUhrzeitfeld4
    = "Quartal 3"}
    if 
    (DatumsUhrzeitfeld4 = "Oktober 2010"){DatumsUhrzeitfeld4
    = "Quartal 4"}
    if 
    (DatumsUhrzeitfeld4 = "November 2010"){DatumsUhrzeitfeld4
    = "Quartal 4"}
    if 
    (DatumsUhrzeitfeld4 = "Dezember 2010"){DatumsUhrzeitfeld4
    = "Quartal 4"}
    Second option:
    http://forums.adobe.com/message/333985#333985
    Sorry, misread the issue. The Quarter will be based on the company you are working for . If their year-end is the same as a calendar yearend (Dec 31), then the example below will be accurate. Change the dates based on the company requirements.
    You can hardcode variables into your application.cfm page.
    quarter1start = "01-jan-";
    quarter2start = "01-apr-";
    quarter3start = "01-jul-";
    quarter4start = "01-oct-";
    The end of each quarter is programatically always the day before the start of the next quarter.
    I would add the 'year' to the equation dynamically, to keep it forward compatible.
    But where shall I write this?
    thx in advance 4 helping me!

  • Set date Parameters to Default to Current Quarter

    I have 2 date parameters in my report. I would like these parameters to be defaulted to the 1st day of the current quarter and the last day of the current quarter. I need these to be dafaulted because the report is going to be scheduled through BusinessObjects InfoView. I need the flexabilty to allow users to run the report on any date they want, but it needs to default so the scheduling works as expected. Can this be done and if so any assistance would be grateful. Thank you.

    Thomas,
    although you can't set a prompt / parameter to default like this, you can set a record selection to do this...here's how...
    1) in your StartDate and your EndDate parameters set a default value of 1888,08,08
    2) create a new formula called Start with syntax like
    if {?startdate} = date(1888,08,08)
    then
    if month(currentdate) in [1,2,3] then date(year(currentdate),01,01) else
    if month(currentdate) in [4,5,6] then date(year(currentdate),04,01) else
    if month(currentdate) in [7,8,9] then date(year(currentdate),07,01) else
    if month(currentdate) in [10,11,12] then date(year(currentdate),10,01)
    else {?startdate};
    3) create a new formula called End with syntax like
    if {?enddate} = date(1888,08,08)
    then
    if month(currentdate) in [1,2,3] then date(year(currentdate),03,31) else
    if month(currentdate) in [4,5,6] then date(year(currentdate),06,30) else
    if month(currentdate) in [7,8,9] then date(year(currentdate),09,30) else
    if month(currentdate) in [10,11,12] then date(year(currentdate),12,31)
    else {?enddate};
    4) change your record selection formula to something like
    {table.datefield} in {@start} to {@end}
    now if the end user doesn't actually put in custom dates, the record filter will default to the current quarter. if they use custom dates, the those dates will be used.
    of course you will have to edit the above syntax to your parameter names and datefield name. this method will also pass the filter to the database to increase performance.
    cheers,
    jamie

  • How to calculate start date and last date for current week

    Dear All.
    i want to calculate the start of the current week as well as the last date of the current week, our week start from Saturday and ends of Friday i.e. Saturday is the first day of the week and Friday is the last day of the week.
    How can i acheive this in universe Designer?.
    Please help...

    Hi
    the formulas in webi will be as follows
    for startdate
    =RelativeDate(LastDayOfWeek(CurrentDate());-8)
    for enddate:
    =RelativeDate(LastDayOfWeek(CurrentDate());-2)
    Regards,
    Ranganath

  • How to get the current month starting date and ending date by default ?

    Hello Creators,
    This is my requirement, kindly do the needful, Please dont gimme any links i've no access for other sites, gimme the right solution.
    My Requirement :
    Creation Date (VBAK-ERDAT) - Select Option. By default, the program should run for the current Month ie between the starting and ending date of the current month when the program is run. Today the date is 18th using sy-datum we can bring the current date by calling it in the initialization event, but the requirement is it should not give me the current date, it should only give me the month starting date and the end date. Kindly help.
    Thanks in advance ...

    DATA: gv_datum LIKE vbak-erdat.
    SELECT-OPTIONS: so_date FOR gv_datum.
    INITIALIZATION.
      CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'
        EXPORTING
          iv_date             = sy-datum
        IMPORTING
          ev_month_begin_date = so_date-low
          ev_month_end_date   = so_date-high.
      so_date-option = 'BT'.
      APPEND so_date.
    START-OF-SELECTION.
    Hope this solves the issue. Don't forget to be generous
    Cheers,
    Sougata.

  • Get the Current Quarter  and Current Week from date

    Hi,
    I want to get the Current quarter and Current week from a given date, which function modules should i use?
    I tried using function module - 'HR_99S_GET_QUARTER' for getting the quarter but it is throwing an error while loading data. Moreover it doesnt exist in BI7.
    Similarly for current week.
    Please help. Sample code snippets would be appreciated.
    Thanks
    Jaya

    You can use FORM time_conversion wich is the one used by standard in Update Rules:
    You can select whether convert 0CALDAY to 0CALWEEK or whatever infobject formats you prefer...
      perform time_conversion
                using  '0CALDAY'
                       '0CALMONTH'
                        p_input_date
                        l_fscvtval
                changing RESULT
                         c_t_idocstate
                         c_subrc
                         c_abort.
      if c_subrc <> 0 or c_abort <> 0.
        exit.
      endif.
    form time_conversion
                   using i_timnm_from type rsiobjnm
                         i_timnm_to   type rsiobjnm
                         i_timvl
                         i_fiscvarnt  type t009b-periv
                   changing e_timvl
                            c_t_idocstate  type rsarr_t_idocstate
                            c_subrc   like sy-subrc
                            c_abort   like sy-subrc. "#EC *
    data: l_timvl  type rsd_chavl,
          l_result type rsd_chavl.
      IF i_timvl CO ' 0'.
        CLEAR e_timvl.
        EXIT.
      ENDIF.
      l_timvl = i_timvl.
      CALL FUNCTION 'RST_TOBJ_TO_DERIVED_TOBJ'
        EXPORTING
          i_timnm_from             = i_timnm_from
          i_timnm_to               = i_timnm_to
          i_timvl                  = l_timvl
          I_FISCVARNT              = i_fiscvarnt
          I_BUFFER                 = rs_c_true
        IMPORTING
          E_TIMVL                  = l_result
        EXCEPTIONS
          INCOMPATIBLE_TOBJS       = 1
          NO_INPUT_VALUE           = 2
          FISCVARNT_MISSING        = 3
          INPUT_NOT_NUMERIC        = 4
          WRONG_DATE               = 5
          WRONG_FISCPER            = 6
          X_MESSAGE                = 7
          OTHERS                   = 8
      e_timvl = l_result.
    ENDFORM.                  "TIME_CONVERSION

  • Retrieve "Start date of Next financial Period" and "Current Period"

    Hi,
    T-code: cne5
    I would like to display 2 new fields in cne5 report result:-
    1) Start date of Next financial Period
    2) Current Period
    I can used
    CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'
         EXPORTING
              I_DATE         = SY-DATUM
              I_PERIV        = 'K4'
    But what is I_PERIV ?
    How can I retrieve the above fields value? Any Function Module that I can used?
    Appreciate helps!
    THanks a lot.

    Hi,
    Yes, i_periv is Fiscal Year Variant.
    From running OB37, I can see that V3 and K4 fiscal year variant. Which one should I used when calling the function module DATE_TO_PERIOD_CONVERT?
    Thanks!

  • Need to display the Current Quarter Data

    Hi Gurus,
    We have a requirement in the report as follows:
    I have a Key Figure - 0Balance. In this it should display the current quarter data.
    We have 5 plants and this report is specific to a plant X which runs 3 month behind.
    So in the variables screen, if I enter 006.2007, it should display the data of 003.2007. Please guide me through the steps...Thanks in advance.

    Hi,
    For getting current quarter data there is std variable available 0CMCQUAR , restrict KF wiht the variable and system should show you current quarter balance.
    For getting balance for previous quarter , copy the kf just created and right click on it , click on the variable right hand side -> specify offset -> put -1. and it should give last quarter data.
    Hope that helps.
    Regards
    Mr Kapadia

  • User start date can not be before the current date

    I'm creating users using the Reconciliation engine. The start date attribute doesn't appear to be reconciling. I get many different types of parse errors. The closest I appear to get is when I set the Xellerate User resource object recon field to have Start date as a date field, i receive the error:
    "User start date can not be before the current date.".
    I'm using 9.0.1.1. And I AM trying to create a user that has a start date before todays date.

    Resolution was to patch to 9.0.1.1578

  • Get all the back schedule start date except last and current month

    Hi All;
    Below gives me last month  schedule start
    scheduledstart >= DATEADD(mm,DATEDIFF(mm,0,GETDATE())-1,0)
    AND scheduledstart < DATEADD(mm,DATEDIFF(mm,0,GETDATE()),0)
    Below gives me current month  schedule start
    scheduledstart >= DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE()), 0)
    AND scheduledstart < DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE())+1, 0)
    I need to find all the schedule start excluding current month and last month
    Any help on this much appreciated
    Thanks
    Pradnya07

    Hi,
    You could use NOT BETWEEN with the start date of last month and the end date of the current month:
    AND schedulestart NOT BETWEEN DATEADD(mm,DATEDIFF(mm,0,GETDATE())-1,0)
    AND DATEADD(MONTH, DATEDIFF(MONTH,
    0, GETDATE())+1,
    0)
    Hope this helps,

  • Converting Coverage Start Date during OAB Conversion for current elections

    We have a requirement to convert the coverage start date of current elections in the Legacy System to OAB.
    We are using 'BEN_ELECTION_INFORMATION.ELECTION_INFORMATION_W' api to convert current enrollments and is passing the actual coverage start date of the current enrollments to the parameter 'p_enrt_cvg_strt_dt' in this API. We have an administrative Life Event configured in OAB for converting the current enrollments with Assigned Life Event date as '29-JUN-2010' . After the Conversion API is executed for all the Enrollment records the coverage Start Date is set to '29-JUN-2010', which is not the requirement.
    We also tried using the APIs 'BEN_PRTT_ENRT_RESULT_API.UPDATE_ENROLLMENT' and 'BEN_PRTT_ENRT_RESULT_API.UPDATE_PRTT_ENRT_RESULT', but they behave the same manner as 'the Legacy System to OAB. We are using 'BEN_ELECTION_INFORMATION.ELECTION_INFORMATION_W'.
    Please let us know which API would allow us to convert the current elections without changing the actual coverage start date from the Legacy System.

    I did run the default enrollment process, but nothing happens. I tried this with the Assign on Default check box checked and unchecked. Here is what I have setup for the enrollment details on this plan:
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Program Enrollment Requirements > General > Plan
    Method: Automatic
    Enrollment: Current, Keep Only; New, Can Choose
    Default Enrollment:
    - Code: Rule
    - Rule: DEV_X
    - Assign on Default: Checked
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    I removed the eligibility profile from the plan and it will default when running the participation process, however that does not solve the problem. I even rewrote the rule to include plan id, but that did not work either. The employee needs to be enrolled automatically when they select a given plan. Because the person is not eligible for the plan until after they select it, OAB will not know that the person is eligible until the participation process is run.
    The only thing I can think is to have a separate life event that triggers at the end of the enrollment period, but I haven't figured how to do that yet. And it still doesn't quite solve the problem completely, as will be the case when enrollments are made after the enrollment period, i.e. corrections.

Maybe you are looking for