TO FIND LAST DAY OF THE YEAR

I am trying to get last day of the year, is oracle provide any inbuilt function to get this otherwise I am using the below mention query is fine.
select last_day(to_date('01'||'/'||'12'||'/'||to_char(sysdate,'YYYY'),'DD/MM/YYYY')) from dual
Thx
Shishu Paul

Hi!
I would prefer using
select to_date('31'||'/'||'12'||'/'||to_char(sysdate,'YYYY')) from dual;
since it is not likely that the last day of any year in near future will be anything else than December 31st.
Regards,
Petra

Similar Messages

  • How to get last day of the year

    Hi All ,
    Thanks in advance ...
    How will I get the last day of the year as I am passing date at run time .
    I can manage to get first day of year by
    SELECT TRUNC(SYSDATE,'YEAR') AS FDAY_YEAR
    from dual
    Thanks in advance
    Regards
    Sachin

      1*  select ADD_MONTHS(trunc(sysdate,'yyyy'),12)-1 dd from dual
    SQL> /
    DD
    31-DEC-2010

  • Need the first day of the year and last day of the year.

    hi all,
    i need a function module which can get me the first day of current year and last day of the current year??
    please help.

    Similar date questions are being asked ALL THE TIME.  Please search.

  • How to find first day of the year

    Big picture: trying to determine how many pay periods are left in the year. There are 52 weeks in a year, and our company pay out each week.
    The first pay week of the year always starts on a Friday. So If Janurary 1 is a friday, then the 1st week of pay period starts that week. If Jan 1 is a Thursday, then the first pay week will start on Janurary 2.
    I need to figure out what day the first day of any year it is. By day, i mean Mon, Tue, Wed, Thur, Fri, Sat, or Sun.
    Then when I figure out what day it is, i will write an if/then statement saying if Jan 1 is a monday, then add 4 days to that date and that will be the first day of a pay period.
    Then when i figure out the first day of the first week, I wanted to add 7 days to create week2, week3.... week 52.
    Then take todays date and if it was between week x and week y, then it would determine that z many pay periods are left...
    is this the best way to go about this? anything easier?

    You can use the getDay method of a Date object to determine the day of the week. Any decent JavaScript reference will have more information.
    George

  • Get first and last day of the year

    and razm.date >= to_date('01.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 entire input string
    01830. 00000 - "date format picture ends before converting entire input string"
    *Cause:   
    *Action:
    :VDATE is input param like 2010. I need to get data from range 1.1.2001 to 31.12.2010
    thx

    user13256715 wrote:
    and razm.date >= to_date('01.01.'||:VDATE||'', 'dd.mm.yyyy') AND razm.date <= to_date('31.12.2010.'||:VDATE||'', 'dd.mm.yyyy');ur making mistake in
    to_date('31.12.2010.'||:VDATE||'', 'dd.mm.yyyy');change it to
    to_date('31.12.'||:VDATE||'', 'dd.mm.yyyy');

  • Number of the day in the year

    Hi,
    I have a requirement to add the number of the day in the year to the message and concatenate with HHMM as shown below
    like this :1205001...12:HH,05:MM; 001(1st day of the year)
    ex2: 0204365...02:HH;04:MM;DDD:365(last day of the year)
    ex3: 0209236..02:HH;09:MM;DDD:236:(236th day of the year)...
    How can i achieve this? any standard functionality?
    please advise.
    Regads

    Hi ,
                 Is it the current system date you wanna concatenate?  Anyways this can be achieved by message mapping using standard functions
    input--------------------------------------------------------------------\
                                                                                concat()--------> target field
    currentdate()--->Transformdate(yyyy/MM/dd,hh:mm:DDD)----------------------/
    If its not system date then you can input any field like "2012/01/02"  or change the format of input date transformdate (the first field).
    Regards
    Anupam

  • SQL select Statement -first day and last day of the month - 1 year from now

    Hi,
    I need to write a SQL to get the dates in between first day and last day of the month one year from now.
    SELECT last_day(add_months(sysdate,12)) as lastday from dual
    What could be the Query to get the first day of the month one year from now..
    ie ..Sysdate - 3-DEC-2009
    Result - 1-DEC-2010
    thank you

    Hi,
    You can use TRUNC with 2 arguments to get the first DATE in a month, year, quarter, week, hour, minute, ISO year, ...
    SELECT  TRUNC ( ADD_MONTHS ( SYSDATE
                               , 12
                  , 'MONTH'
                  )     AS first_of_month
    FROM    dual
    ;The DATE returned will be in the same month, year, quearter, ... as the first argument.
    \We convered the last day of the month in [your previous question|http://forums.oracle.com/forums/message.jspa?messageID=3942939#3942939].
    At that time, I warded about using LAST_DAY as a cutoff point; TRUNC is a much better way.
    For example, to find all appointment_dates in the current month next year:
    SELECT  *
    FROM    appointments
    WHERE   appointment_date >= TRUNC (ADD_MONTHS (SYSDATE, 12), 'MONTH')
    AND     appointment_date <  TRUNC (ADD_MONTHS (SYSDATE, 13), 'MONTH')Note that
    the first part of the WHERE clause calls for dates on or equal to the beginning of the 12th month in the future, but
    the second part of the WHERE clause calls for dates before, not equal to , the beginning of the 13th month in the future.

  • Need to find the last day of the previous month

    hi folks,
    the code goes like this...
    data: xt247 type t247,
          monthn(30) type c,
          monthnumber type i,
          bforwardmonth type i.
    call function 'RP_LAST_DAY_OF_MONTHS'
      EXPORTING
        day_in            = s_date
      IMPORTING
        last_day_of_month = e_date.
    write: 'The last day of the month', e_date.
    select single * from t247 into xt247
            where spras = sy-langu
              and mnr = e_date+4(2).
    monthnumber = xt247-mnr.
    write:' The month number', monthnumber.
    determine the previous month.
    bforwardmonth = monthnumber - 1.
    From here I need to determine the last day of the previous month How can I do?
    Thanks for your help.
    Santhosh

    Hi all,
    here's the shortest solution:
    REPORT z123.
    PARAMETERS p_datum LIKE sy-datum DEFAULT sy-datum.
    DATA ultimo  LIKE sy-datum.
    <b>ultimo = p_datum - p_datum+6(2).</b>
    WRITE: / p_datum, 20 ultimo COLOR 2.
    it's not my solution :
    it's from <a href="http://www.abapforum.com/forum/viewtopic.php?t=1434&highlight=ultimo">Andrew_</a>
    regards Andreas

  • How can I find the last day of the current month

    Is it possible to get the last day of the month in reports. Suppose I enter JUL in one of the text field. Now in reports I want to show that JUL contains 31 days. How can I retrieve the last day of the month.
    Any ideas?

    The first (and fast) solution I think is this:
    There is a function MONTH(CURRENT_DATE) that returns the number of the month of the current date.
    Now, you could use CASE WHEN expressions to determine the number of days returned since you now how many days does every month have.
    For instance, you could do:
    CASE
    WHEN MONTH(CURRENT_DATE)=1 THEN 31
    WHEN MONTH(CURRENT_DATE)=2 THEN 28
    WHEN MONTH(CURRENT_DATE)=3 THEN 31
    WHEN MONTH(CURRENT_DATE)=4 THEN 30
    END
    PD. This is faster that use OR expressions like 1 or 3 or 5 because you dont have to try every option.
    Hope it helps...but maybe there is another way more automatic.
    Edited by: linkln on 03/09/2010 08:21 AM

  • How to get the last day of the previous month

    Hello Team,
    If  my input date is today , then i need to find out the last day of the previous month for the same.
    Can someone help me  to find out .. how can this be done.
    Regards,
    Ravi

    Hi,
    Try the below code.
         // get a calendar object
        GregorianCalendar calendar = new GregorianCalendar();
        // convert the year and month to integers
        int yearInt = Integer.parseInt(year);
        int monthInt = Integer.parseInt(month);
         int dayInt = Integer.parseInt(day);
        // adjust the month for a zero based index
        monthInt = monthInt - 1;
        // set the date of the calendar to the date provided
        calendar.set(yearInt, monthInt, dayInt);
        int day = calendar.getActualMaximum(GregorianCalendar.DAY_OF_MONTH);
        return Integer.toString(day);
    Regards
    Venkat

  • Currency Translation based on Last Day of the Acquistion month

    Dear all,
                Request to help me in understanding how we can calculate the currency translation rate as per the last day if the acquistion month..
    For Example if the  Acquistion date : 01/01/2008 (mm/dd/yyyy) the currency translation should happend based on the rate maintained as on 31/01/2008.
    Thanks
    Pavan Kumar Prakhya

    First, you will need to convert the actual acquisition date to the end date of the Fiscal Period. This can be done by using two separate Function Modules. First, get the actual Fiscal Period by entering the date and Fiscal Year Variant into the DATE_TO_PERIOD_CONVERT Function Module. Use the Fiscal Year and Fiscal Period from this and determine the end date of the Fiscal Period by using Function Module LAST_DAY_IN_PERIOD_GET with Fiscal Year, Fiscal Period and Fiscal Year Variant as your inputs.
    For the conversion, use the Function Module CONVERT_TO_LOCAL_CURRENCY. The inputs for this would be the last date of the Fiscal Period, the amount to be converted, the from currency code, the to currency code, blank in rate, AS01 in type of rate and X in read TCURR. This assumes, however, that month-end rates (rate type = AS01) have been loaded into your source system and these rates have been transferred to your BW environment.

  • ICal 3.0: Last day of the month repeating event

    I am migrating back to iCal after a few years using Entourage. I am trying to set up calendar events and reminders for the last day of every month, but I can't figure out how to do it. In Entourage this was easy. Any advice? Thank you.

    I would like this to be an easy feature included in iCal as I get paid on the 16 and second to last day of the month. I want iCal to show the event in the calendar, not for me to set the event and have an alarm for 24 hours before. I tried the trick found at http://www.macworld.com/article/47872/2005/11/trickical.html but that does not work with iCal 3.0.
    Any help would be appreciated or maybe Apple adding this in the repeating section of the ical event seeing it is apart of the icalendar specification.
    tim

  • Formula to calculate the last day of the subsequent month

    Hi - I am trying to create a formula in CR9 that will take a date field and translate it to the last day of the subsequent month.  For example, I have a date of today, 2/3/2009.  I need it to print on the report 3/31/2009.  I have made some progress to get me the 1st day of the subsequent month, but I need it to be the last day of the subsequent month.
    The formula I am have currently is:
    DateSerial(Year({Name.JOIN_DATE}), Month({Name.JOIN_DATE}) + 1, 0)+1
    this will give me 3/1/2009, but I need 3/31/2009.
    Any help appreciated. 
    Thanks!

    Hi Joe,
    You can use the following logic which also takes into account the extra day in a leap year.  You will need 5 formulas for this:
    First create a formula that calculates current month, call it @Current Month MM
    Month(Name.JOIN_DATE)+1
    Next create another formula called @Current Month Start Date which will give you the beginning of the month.
    totext(Date (year(currentdate),tonumber({@Current Month MM}) ,1 ))
    Next create another formula called @Current Year yyyy
    Year(Name.JOIN_DATE)
    Next, create a formula called @DaysofMonth with the following logic:
    if tonumber({@Current Year yyyy}) mod 4 = 0 then
    choose(month(date({@Current Month Start Date})),31,29,31,30,31,30,31,31,30,31,30,31) else
    choose(month(date({@Current Month Start Date})),31,28,31,30,31,30,31,31,30,31,30,31)
    Lastly create a formula called @Ending Date of Month
    totext(Date (year(currentdate),tonumber({@Current Month MM}) ,{@DaysOfMonth} ))
    I hope this information proves useful.
    Regards,
    Zack H.
    Edited by: Zack H on Feb 3, 2009 5:34 PM
    Edited by: Zack H on Feb 3, 2009 5:38 PM

  • First and last day of current year as a date object

    Howdy...
    can someone please help me out... i need a fast way to get the first day of the current year as a date object and the last day of the current year as a date object...
    big thanks for any sample code...

    import java.util.Calendar;
    // snip
    Calendar firstDayOfYear = Calendar.getInstance(); // will initialize it with today
    firstDayOfYear.set(Calendar.DAY_OF_MONTH, 1);
    firstDayOfYear.set(Calendar.MONTH, Calendar.JANUARY);
    Calendar lastDayOfYear = Calendar.getInstance(); // will initialize it with today
    lastDayOfYear.set(Calendar.DAY_OF_MONTH, 31);
    lastDayOfYear.set(Calendar.MONTH, Calendar.DECEMBER);Rommie.

  • FI : Finding last day of last accounting period

    Hi,
    In fi, I am trying to find out the last date od the last accounting period.
    I.e, if december is my first accounting period, and i give 28.01.2009 , my current accounting period will be 02,so last date of last period(december 2008) would be 31.12.2008
    Similalry, if December is the start of the accounting period,meaning december is accounting period 1, the, last day of the last accounting period would be: 30.11.2007.
    Please let me know of function modules to:
    1.Find the last period
    2.find the last day of the last period
    Thanks in advance..
    sumita

    Hi,
    You can try using function module LAST_DAY_IN_PERIOD_GET to get the last day in a month/period.
    You might have to check with the help of FI consultant what Fiscal Variant needs to be used.
    Also uou can find out the previous month by subtracting 1 from the current month ( and if month - 1 = 0 previous period is 12 ).
    Regards,
    Ram

Maybe you are looking for

  • Getting values from a selectbox

    hi all ! I have a dynamic select box declared as : <select id="Agenda" multiple="multiple" size="12"> <c:forEach var="Agenda" items="${sessionScope.Agenda}"> <option value="${Agenda}">${Agenda}</option> </c:forEach>  </select>How do I to retreive all

  • How to identify the type of pocketpc barcode scanner?

    How to identify the type of pocketpc barcode scanner whteher it is intermec or symbol? GS

  • Objects converted to symbols not showing up in workspace CS4

    Has anyone have this problem?  It's extremely problematic when you're trying to design something.  It plays fine when tested, but you cant see anything that's converted to a graphic, button, or movie clip.  I tried uninstalling and reinstalling, rebo

  • Color of prints to epson 2200 suddenly shifted.

    I am running 10.4.11 and print to an Epson 2200 printer. I am pretty good on profiles and color management. All of a sudden I am experiencing a color shift on some of my tried and true images. The images are darker and have a green shift and no vibra

  • Exception when trying to use page flow diagrammer

    I can no longer use the struts-config page flow diagrammer (jdeveloper 9.0.5.2). In the jdeveloper console the following error is displayed when i try to open the diagrammer: java.lang.NoSuchMethodError: org.apache.batik.dom.svg.ExtensibleSVGDOMImple