Last day of the year in fast formula

Hi all

I have to deal with something special, based on the last day of the current year.

How can I get the last day of the year? Is there a function available in the fast formulas?

Appreciate all entries...

Thank you
SRS

What is

:
L_last_day = TO_DATE (' 31 - DEC-'+ TO_CHAR (PAY_PROC_PERIOD_END_DATE, 'YYYY'), 'DD-MON-YYYY')
:

Clive

Tags: Oracle Applications

Similar Questions

  • How to get the last day of the year

    Hi all

    Thanks in advance...

    How do I get the last day of the year that I'm passing date at run time.

    I can manage to get the first day of the year by
    SELECT TRUNC(SYSDATE,'YEAR') AS FDAY_YEAR
    of the double

    Thanks in advance

    Concerning
    Sachin
      1*  select ADD_MONTHS(trunc(sysdate,'yyyy'),12)-1 dd from dual
    SQL> /
    
    DD
    -----------
    31-DEC-2010
    
  • get the first and last day of the year

    and razm.date > = to_date ("' 1.01 ' |: $VDATE |", ' dd.mm.yyyy ") AND razm.date < = to_date ('31.12.2010. ' || (": $VDATE |", ' dd.mm.yyyy ");

    but I get:
    ORA-01830: date format picture ends before converting all of the input string
    01830 00000 - "date format picture ends before converting all of the input string.
    * Cause:
    * Action:


    : $VDATE is entered as 2010 param. I need to get data from range 1.1.2001 to 31.12.2010

    THX

    Why don't you use:

    to_char(razm.date,'YYYY') = :VDATE
    
  • Select SQL - last day of the month, a year from now

    Hello
    How do we get the last day of the month, a year from now.

    For example-sysdate-12/2/2009
    Result - 31/12/2009

    Thank you

    Hello

    SELECT  LAST_DAY ( ADD_MONTHS ( SYSDATE
                                  , 12
                )           )
    FROM    dual;
    

    Remember, all DATEs, including the results of this query, include the hours minutes and seconds.
    The hours, the minutes and the seconds returned by the above expression are the same as SYSDATE: If you run it at 15:43:30 today, it returns 15:43:30 on December 31, 2010. This can be important if you want to use an expression like this as the cut-off point in a WHERE clause.

  • Breaking a year in coming weeks of beginning and end Dates (parameters) and first and last day of the month

    Hello people:

    I have currently a query that picks up all the weeks between a date range where my week starts on Thursday and ends on Wednesday. The following query works fine except that I need the week of beginning and end, from beginning and end Dates of months and the beginning and the Dates of end of the values of the settings, I'm passing. In this case, I chose January 1, 2013 to 31 December 2013.

    Any help or pointers would be great!

    Thank you!

    Problem: I am picking up days of December 2012 as the first week began on December 27, 2012. In addition, in December, I'm pretty much lost last week as well (26 December - 31 December).

    The request in hand:

    SELECT first_thursday + (7 * (LEVEL - 1))   AS week_start_date,
                     first_thursday + (7 * LEVEL) - 1    AS  week_end_date
    FROM
    (
      SELECT TRUNC(p_from_date + 4, 'IW') - 4   AS first_thursday, -- Week should start the pre ceeding THURSDAY based on the Start Date
                      TRUNC( p_to_date + 4,  'IW') - 5     AS last_wednesday
      FROM
      (
        SELECT to_date('01-JAN-2013') AS p_from_date,
                        NVL(to_date('31-DEC-2013'), SYSDATE) AS p_to_date
        FROM     dual
      ) parms
    ) end_points
    CONNECT BY LEVEL <= ( last_wednesday + 1 - first_thursday)/7;
    

    Currently, this is the result I get (I'm only including the months of January and December here).

    Week_Start_Date     Week_End_Date
    27-DEC-12                02-JAN-13
    03-JAN-13                 09-JAN-13
    10-JAN-13                 16-JAN-13
    17-JAN-13                 23-JAN-13
    24-JAN-13                 30-JAN-13
    31-JAN-13                 06-FEB-13
    

    December:

    28-NOV-13               04-DEC-13
    05-DEC-13              11-DEC-13
    12-DEC-13              18-DEC-13
    19-DEC-13              25-DEC-13
    

    What I would really like is based on start and end Dates, as well as the first and the last day of the month is similarly try nicely. I have provided and then gently break at the end of the month:

    January:

    01-JAN-13              02-JAN-13
    03-JAN-13              09-JAN-13
    10-JAN-13             16-JAN-13
    17-JAN-13             23-JAN-13
    24-JAN-13             30-JAN-13
    31-JAN-13             31-JAN-13
    

    February:

    01-FEB-13    06-FEB-13
    07-FEB-13    13-FEB-13
    14-FEB-13    20-FEB-13
    21-FEB-13    27-FEB-13
    28-FEB-13    28-FEB-13
    

    November:

    31-OCT-13    06-NOV-13
    07-NOV-13    13-NOV-13
    14-NOV-13    20-NOV-13
    21-NOV-13    27-NOV-13
    28-NOV-13    04-DEC-13
    

    December:

    01-DEC-13           04-DEC-13
    05-DEC-13           11-DEC-13
    12-DEC-13          18-DEC-13
    19-DEC-13          25-DEC-13
    26-DEC-13          31-DEC-13
    

    Hello

    Roxyrollers wrote:

    Hello people:

    I have currently a query that picks up all the weeks between a date range where my week starts on Thursday and ends on Wednesday. The following query works fine except that I need the week of beginning and end, from beginning and end Dates of months and the beginning and the Dates of end of the values of the settings, I'm passing. In this case, I chose January 1, 2013 to 31 December 2013.

    Any help or pointers would be great!

    Thank you!

    Problem: I am picking up days of December 2012 as the first week began on December 27, 2012. In addition, in December, I'm pretty much lost last week as well (26 December - 31 December).

    The request in hand:

    1. First_thursday SELECT + (7 * (LEVEL - 1)) AS week_start_date,
    2. first_thursday + (7 * LEVEL)-1 AS week_end_date
    3. Of
    4. (
    5. SELECT TRUNC (p_from_date + 4, 'IW') - 4 AS first_thursday,-week should start to perform the pre-mounted THURSDAY based on the Start Date
    6. TRUNC (p_to_date + 4, 'IW') - 5 AS last_wednesday
    7. Of
    8. (
    9. SELECT to_date('01-JAN-2013') AS p_from_date,
    10. NVL (to_date('31-Dec-2013'), SYSDATE) AS p_to_date
    11. OF the double
    12. ) parms
    13. ) end_points
    14. CONNECT BY LEVEL<= (="" last_wednesday="" +="" 1="" -="">

    Currently, this is the result I get (I'm only including the months of January and December here).

    1. Week_Start_Date Week_End_Date
    2. DECEMBER 27, 12 2 JANUARY 13
    3. JANUARY 3, 13 JANUARY 9, 13
    4. 10 JANUARY 13 JANUARY 16, 13
    5. 17 JANUARY 13 23 JANUARY 13
    6. 24 JANUARY 13 30 JANUARY 13
    7. 31 JANUARY 13 FEBRUARY 6, 13

    December:

    1. NOVEMBER 28, 13 4 DECEMBER 13
    2. 5 DECEMBER 13 DECEMBER 11, 13
    3. 12 DECEMBER 13 18 DECEMBER 13
    4. 19 DECEMBER 13 DECEMBER 25, 13

    What I would really like is based on start and end Dates, as well as the first and the last day of the month is similarly try nicely. I have provided and then gently break at the end of the month:

    January:

    1. JANUARY 1, 13 2 JANUARY 13
    2. JANUARY 3, 13 JANUARY 9, 13
    3. 10 JANUARY 13 JANUARY 16, 13
    4. 17 JANUARY 13 23 JANUARY 13
    5. 24 JANUARY 13 30 JANUARY 13
    6. 31 JANUARY 13 JANUARY 31, 13

    February:

    1. 1ST FEBRUARY 13 FEBRUARY 6, 13
    2. 7 FEBRUARY 13 FEBRUARY 13, 13
    3. 14 FEBRUARY 13 FEBRUARY 20, 13
    4. 21 FEBRUARY 13 FEBRUARY 27, 13
    5. 28 FEBRUARY 13 FEBRUARY 28, 13

    November:

    1. 31 OCTOBER 13 NOVEMBER 6, 13
    2. 7 NOVEMBER 13 NOVEMBER 13, 13
    3. 14 NOVEMBER 13 NOVEMBER 20, 13
    4. 21 NOVEMBER 13 NOVEMBER 27, 13
    5. NOVEMBER 28, 13 4 DECEMBER 13

    December:

    1. 1ST DECEMBER 13 DECEMBER 4, 13
    2. 5 DECEMBER 13 DECEMBER 11, 13
    3. 12 DECEMBER 13 18 DECEMBER 13
    4. 19 DECEMBER 13 DECEMBER 25, 13
    5. 26 DECEMBER 13 DECEMBER 31, 13

    Why the "weeks" in November, have all 7 days, while the "weeks" in the first or the last week in the other month usually have less?  (For example, February 28 is a 'week' alone.)

    The following works for the other months:

    WITH all_days AS

    (

    SELECT DATE "2013-01-01' + LEVEL - AS a_date 1

    OF the double

    CONNECT BY LEVEL<=>

    )

    SELECT DISTINCT

    More GRAND (TRUNC (a_date + 4, 'IW') - 4)

    , TRUNC (a_date, 'MONTH')

    ) AS week_begin

    , The LEAST (TRUNC (a_date + 4, 'IW') + 2

    TRUNC (LAST_DAY (a_date))

    ), Week_end

    Of all_days

    ORDER BY week_begin

    ;

    Output:

    WEEK_BEGIN WEEK_END

    ----------- -----------

    January 1, 2013 January 2, 2013

    January 3, 2013 January 9, 2013

    January 10, 2013 January 16, 2013

    January 17, 2013 January 23, 2013

    January 24, 2013 January 30, 2013

    January 31, 2013 January 31, 2013

    February 1, 2013 February 6, 2013

    February 7, 2013 February 13, 2013

    February 14, 2013 February 20, 2013

    February 21, 2013 February 27, 2013

    February 28, 2013 February 28, 2013

    ...

    November 1, 2013 November 6, 2013

    November 7, 2013 November 13, 2013

    November 14, 2013 November 20, 2013

    November 21, 2013 November 27, 2013

    November 28, 2013 November 30, 2013

    December 1, 2013 December 4, 2013

    December 5, 2013 December 11, 2013

    December 12, 2013 December 18, 2013

    December 19, 2013 December 25, 2013

    26 December 2013 31 December 2013

  • How to get sales last day of the previous month

    HELO guys

    I have a question how do I get sales date last day of the previous month where my fact table is level. in fact I tried using Ago but it seems not working. for example, if I chose December 29, 2014 so if I used the function there are then the result will display data on November 29, 2014 (not the last day of November 2014).

    Please guys if you have any solution and I really advise thanks to you.

    Not exactly under what circumstances specific as you try to reach this goal, but suppose you have a few guest dashboard where you select a day and you have a report with a measure where you want to show the sales of the last day of the previous month based on the selected date in the dash prompt.

    If you change the formula of this measure to something like:

    FILTER (with the HELP of 'Sales' (DATE = TIMESTAMPADD (SQL_TSI_DAY-1, TIMESTAMPADD (SQL_TSI_DAY, DAYOFMONTH(@{PV_DATE_SELECTED}) * (-1) + 1, @{PV_DATE_SELECTED}))))

  • Get the last day of the month

    Hello

    How can I get the (day number of the) last day of a given month and year?

    So, if

    year 2015 = and month = 1, the output should be 31

    year = 2012 and month = 2 while production is expected to be 29

    year 2013 = and month = 2 while production is expected to be 28

    etc.

    Y at - it no OBIEE to achieve? If not, then a command SQL Oracle is very good too (I prefer OBIEE however)

    Thanks in advance,

    Erik

    You start from the first day of the month, you add 1 month [TIMESTAMPADD (SQL_TSI_MONTH, 1, 'your date')], you must subtract 1 day [TIMESTAMPADD (SQL_TSI_DAY,-1, 'your date')] and use the DAYOFMONTH function to get the number of the last day of the month [DAYOFMONTH ('your ' date')].

    All these calls nesting together and you're there.

  • How to read the date of the day of the day of the year?

    I want to put 30 days for the test of endurance for the application of the components. the user will have the current value of 30 days with specify them the end of the day.

    I saw that the "seconds to Date/Time.vi" sure I checked the day of the year. If I can use this day of the year, I can add + 30 read 30 date.

    Barros,

    What I gave was the answer you were looking for originally because I believe.  You will not just be able to read the date in a coherent way and then add 30.  You can either use the function Get time in seconds or a few varaint it and then add the offset you want (you could use the get a Date/time string and enter the date directly, but this digital conversion which will be useful in the monitoring of the time elapsed will be much more difficult than what I provided only).  If you want to stop the test, simply to keep track of the amount of time the test is in pause and extension at the time where that amount.

    Cheers, Matt

  • calculate the time in seconds, the day of the year and year

    I have a data file where they record three columns, the seconds elapsed since midnight, day of the year and the year.  I am creating a timestamp of LabVIEW from these three numbers.  Of seconds elapsed since midnight, I can create seconds, minutes and hours.  If I feed in a cluster of time with the day of the year and the year, the timestamp of output is 0.  Does not work.  Although an input of the day of the year element, the Date and time with seconds function apparently requires day for months and months to work.

    The only solution I can imagine at this stage is to calculate the month and the day of the day of the year, which would imply a choice of the month table and a check of the leap year.

    Smart solutions, I'm missing?

    DaveT

    Dave,

    I found a Julian Georgian so far.

  • How to get the last day of the week?

    HII

    I can get the week number of calendar for a given date using

    SELECT to_char (to_date('04/04/2011','MM/DD/YYYY'), 'WW') FROM dual

    can any body tell me, how to get the last day of the week?

    and the answer should be: 04/08/2011(8th april)
    Thank you
    San

    Published by: sandeep9 on April 4, 2011 03:50

    Perhaps this...

    SQL> select trunc(sysdate,'WW')+6 from dual;
    
    TRUNC(SYSDATE,'WW')+
    --------------------
    08-APR-2011 00:00:00
    
    SQL>
    
  • 1st day of the year then the Monday group

    Hello expert;

    I have the following tables below
    create table table_one
    (
     v_id varchar2(60),
     close_date date
    );
    insert into table_one
      (v_id, close_date)
    values
      ('A', to_date('1/1/2010 4:47:09 PM', 'MM/DD/YYYY HH:MI:SS:AM'));   --- First day of the year
    
    insert into table_one
      (v_id, close_date)
    values
      ('B', to_date('1/4/2010 2:47:09 PM', 'MM/DD/YYYY HH:MI:SS:AM'));   -- monday
      
      insert into table_one
      (v_id, close_date)
    values
      ('C', to_date('1/11/2010 1:47:19 PM', 'MM/DD/YYYY HH:MI:SS:AM'));  -- monday
      
     insert into table_one
      (v_id, close_date)
    values
      ('D', to_date('5/6/2010 5:47:09 PM', 'MM/DD/YYYY HH:MI:SS:AM'));  --- not a monday
      
     insert into table_one
      (v_id, close_date)
    values
      ('E', to_date('5/3/2010 4:47:09 PM', 'MM/DD/YYYY HH:MI:SS:AM'));  ---monday
      
     insert into table_one
      (v_id, close_date)
    values
      ('F', to_date('2/9/2010 5:17:09 PM', 'MM/DD/YYYY HH:MI:SS:AM'));  -- not monday
    I need to modify my query below and I can't think of a good way to go about it
    select t.v_id, to_char(t.close_date, 'YYYY-MM-DD') from table_one t
    where t.close_date between to_date('2010/1/1', 'YYYY-MM-DD') and to_date('2010/12/31', 'YYYY-MM-DD')
    group by t.v_id, to_char(t.close_date, 'YYYY-MM-DD');  
      
    what I'm trying to do is in fact I want to group by only Mondays









    Edited by: user13328581 on Nov 17, 2010 8:04 AM
    
    Edited by: user13328581 on Nov 17, 2010 8:04 AM
    
    Edited by: user13328581 on Nov 17, 2010 8:29 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
    select t.v_id, to_char(t.close_date, 'YYYY-MM-DD')
      from table_one t
    where t.close_date between to_date('2010/1/1', 'YYYY-MM-DD') and to_date('2010/12/31', 'YYYY-MM-DD')
    and   to_char(trunc (t.close_date), 'dy' ) = 'mon'
    
    V_ID     TO_CHAR(T.CLOSE_DATE,'YYYY-MM-DD')
    B     2010-01-04
    C     2010-01-11
    E     2010-05-03
    

    If you also want the first day of the year that you mentioned.

    select t.v_id, to_char(t.close_date, 'YYYY-MM-DD')
      from table_one t
    where t.close_date between to_date('2010/1/1', 'YYYY-MM-DD') and to_date('2010/12/31', 'YYYY-MM-DD')
    and   to_char(trunc (t.close_date), 'dy' ) = 'mon'
    or  extract( month from t.close_date) + extract( day from t.close_date) = 2
    
    V_ID     TO_CHAR(T.CLOSE_DATE,'YYYY-MM-DD')
    A     2010-01-01
    B     2010-01-04
    C     2010-01-11
    E     2010-05-03
    

    Published by: pollywog on November 17, 2010 11:38

  • Last day of the month with the last minute of the day

    Hello
    I wonder about how to get the last day of the month with the last minute of this day(23:59). We can use the last_day function (DATE) to get the last date, but reminds me of the time of day when the function has been executed. But I want to have the last minute with my last date of the current month.

    Please inform.

    Thank you

    HP

    Hello

    Ora_bie wrote:
    Hello
    I wonder about how to get the last day of the month with the last minute of this day(23:59). We can use the last_day function (DATE) to get the last date, but reminds me of the time of day when the function has been executed. But I want to have the last minute with my last date of the current month.

    In fact, it returns at the same time as the argument you pass; But whatever it is, is not what you want.

    This will return the last day of the month that contains the DATE 23:59 (or 23:59) dt:

    SELECT  ADD_MONTHS ( TRUNC (dt, 'MONTH')
                 , 1
                 ) - (1 / (24 * 60))
    FROM    dual
    ;
    

    TRUNC (dt, 'MONTH') is 00:00 on the first day of the month that contains dt.
    ADD_MONTHS (TRUNC (dt, 'MONTH'), 1) is from 00:00 the first day of the month following the one containing dt.
    ADD_MONTHS (TRUNC (dt, 'MONTH'), 1)-(1 / (24 * 60)) is a minute earlier.
    (Since there are 24 hours, each with 60 minutes, every day, 1 / (24 * 60) days is identical to a minute.)

    Another (less clear, in my opinion) way to get the same results is:

    TRUNC (LAST_DAY (dt)) + (1439/1440)  -- 1440 minutes = 1 day
    
  • ORA-01847: day of the month must be between 1 and the last day of the month

    Hi all






    Select
    To_date(mDate||) e '|| mtime, "YYYY-MM-DD HH24MISS") meddate
    of PR_MOCTEST_TEMP

    mDate IS OF TYPE of DATA VARCHAR2 AND mtime OF VARCHAR2

    mDate: 07-09-2009
    mtime: 131241

    mDate IS IN FORMAT DD-MONTH-YYYY
    mtime: HHMMS

    mtimeOF IS OF TYPE of DATA VARCHAR2 AND VARCHAR2 mDate

    mDate: 07-09-2009
    mTIME: 131241

    mDATE IS IN FORMAT DD-MONTH-YYYY
    mTIME: HHMMS

    I NEED TO COMBINE THE 2 COLUMNS TO GET THE OUTPUT AS DD-MM-YYYY HH24MISS
    AND I AM GETTING THE ERROR;


    ORA-01847: day of the month must be between 1 and the last day of the month

    where mistaken?

    Please notify


    Kai

    You will find the bad dates using a table of logging of errors:

    --we'll try to insert into here, invalid dates will be thrown out
    create table dst(d date);
    
    -- create an error log table dst_err
    exec dbms_errlog.create_error_log('dst', 'dst_err');
    
    -- try the insert. Will fail with your ORA-01847
    insert into dst select TO_DATE(mdate||' '||mtime,'DD-MM-YYYY HH24MISS') from PR_MOCTEST_TEMP log errors into dst_err('comment'); 
    
    -- view the errors
    select * from dst_err;
    
  • BEEP Scheduler - last day of the month

    Is there a a way to schedule reports to run on the last day of the month using the Scheduler of BEEP? I see that I can choose to run the monthly report and I choose the day to run it, but the last day of the month is different from one month to the other most of the time. Is it possible to do so in the Scheduler?

    Thank you!

    Oops, my bad,
    I did not review the request clearly.

    There is possibility to plan the report, because every month and he asks date of the month.
    If you register 31, his is not going to run it for each month, since used 31 are present in every month.

    Note: And there is no provision in the bi-editeur before you do :), front-end Bi Publisher accuses this support.
    You can use WebService at fire report every end of month :), but if you seek support front end 'calendar' homepage, start SR.

    As far as I know, its a bug, please contact technical support and connect a SR and let me know of the State.

  • calculate the day of the year using the date.

    Hi all
    Can calculate us the day of the year using the date form? Is this possible? Please help me thanks in advance
    Like this
    30/08/2009-30/08/2010 after calculation - 365


    Sarah

    Published by: SarahSarahSarah on August 30, 2009 12:49 AM

    Sarah.

    : ins1.noday must be a part of number!

    Create a function in forms like this:

    function get_nodays ( f_dtm_start in date,
                          f_dtm_end   in date ) return number is
    begin
    if
      f_dtm_start is null OR
      f_dtm_end is null
    then
      return ( null );
    end if;
    return ( trunc ( f_dtm_start ) - trunc ( f_dtm_end ) );
    exception when others
    then message ( sqlerrm || ' in function get_nodays occured.' );
    return ( null );
    end;
    

    Call this function in the when-validate-point triggers on ins1. INSPERIOD and: ins1.end love

    :ins1.noday := get_nodays ( :ins1.INSPERIOD, :ins1.end );
    

    It is redundant to have the: noday as a cause of part of database
    the value may by calculated every time using the values INSPERIOD and: end.

Maybe you are looking for

  • Qosmio G30-194: film sound Vista instalation question

    After I installed Vista on my Qosmio G30-194 I have problems with sound card (when I play a movie I can't hear the sound of the characters, but I hear very clearly the surrounded sound) and Dolby are not working.

  • How can I make my HP J4680 printer scan a document

    Original title: Scanning documents from the printer How can I make my HP J4680 printer scan a document?  Adjustment during SCAN and pressing the button Green Start evokes "digitization to:" printer window but I can't find a way to answer it... I can'

  • Why my printer does not print no matter what doc in the my Docs section? It is used to

    I used to be able to present a paper, put it in my Docs and then call and print it out.      Now I can not one of my printed docs.    There seems to be a block print of one of my docs and I don't understand why.    It is operated from my OK ports in

  • Fees to get answers?

    I posted several questions in March 2010 on the impossibility to receive e-mails with attachments jpg.  It seems now that Microsoft charged my credit card for something, apparently a response.  No one, including MS, never offered a solution to my pro

  • PCI device &amp; problem Driver control Ethernet in HP 2000-2128TU

    Name of the product - HP 2000-2128TU Windows 8 and 7 After using a few months Windows 8 in my laptop suddenly I did deal with any Modem does not work. Unable to connect to the internet. Then I found after a huge search with some error in PCI Device D