How to find the sum of the month and year of a date

Hi all

I want to find the sum of the date
for example, 10 November 2010 I need to find (11-2010).

Please help me

You can use the extract function...

SQL> select extract(month from systimestamp)+extract(year from systimestamp) from dual;
            EXTRACT(MONTHFROMSYSTIMESTAMP)+EXTRACT(YEARFROMSYSTIMESTAMP)
                                    ------------------------------------------------------------
                                                        2021

Concerning
Renjith Malet

Tags: Database

Similar Questions

  • To find the months and days between 2 dates

    Hello

    I want to find the months and days between 2 dates.

    For example.

    1 - Date: August 25, 2013

    2 - Date: October 23, 2013

    If we consider each month 30 days, it should give

    August 25, 2013 to August 30, 2013 = 6 days

    01-Sep-2013-30-Sep-2013 = 1 month

    October 23, 2013 to October 30, 2013 = 8 days

    Total = 1 month and 14 days.

    Kindly help as soon as possible.

    Thanks and greetings

    Suresh

    Assuming that d2 > d1,.

    where d)

    Select sysdate d1, sysdate + 56 double d2

    Union all select to_date (March 1, 2013 ',' dd-mon-yyyy "") d1, to_date (March 31, 2013 ',' dd-mon-yyyy ') d2 double

    Union all select to_date (5 February 2013 ',' dd-mon-yyyy ') d1, to_date (March 31, 2013 ',' dd-mon-yyyy "") double d2

    Union all select to_date (February 25, 2013 ',' dd-mon-yyyy "") d1, to_date (March 23, 2013 ',' dd-mon-yyyy ') d2 double

    Union all select to_date (February 25, 2013 ',' dd-mon-yyyy ') d1, to_date (March 31, 2013 ',' dd-mon-yyyy "") double d2

    Union all select to_date (August 2, 2013 ',' dd-mon-yyyy "") d1, to_date (29 October 2013 ',' dd-mon-yyyy ') d2 double

    Union all select to_date (February 1, 2013 ',' dd-mon-yyyy "") d1, to_date (May 31, 2013 ',' dd-mon-yyyy ') d2 double

    Union all select to_date (25 August 2013 ',' dd-mon-yyyy "") d1, to_date ('03-Sep-2013', 'Mon-dd-yyyy') d2 double

    Union all select to_date (July 30, 2013 ',' dd-mon-yyyy "") d1, to_date (August 31, 2013 ',' dd-mon-yyyy ') d2 double

    Union all select to_date (July 31, 2013 ',' dd-mon-yyyy ') d1, to_date (August 30, 2013 ',' dd-mon-yyyy "") double d2

    Union all select to_date (July 31, 2013 ',' dd-mon-yyyy ') d1, to_date (3 August 2013 ',' dd-mon-yyyy "") double d2

    Union all select to_date (3 July 2013 ',' dd-mon-yyyy "") d1, to_date (August 31, 2013 ',' dd-mon-yyyy ') d2 double

    Union all select to_date ('31-08-2013', ' dd-mm-yyyy'), to_date('05-10-2013','dd-mm-yyyy') of the double

    Union all select to_date ('05-02-2013', ' dd-mm-yyyy'), to_date('31-03-2013','dd-mm-yyyy') of the double

    Union all select to_date ('05-02-2013', ' dd-mm-yyyy'), to_date('05-03-2013','dd-mm-yyyy') of the double

    Union all select to_date ('05-02-2013', ' dd-mm-yyyy'), to_date('05-02-2013','dd-mm-yyyy') of the double

    )

    Select d1, d2,

    1 + 30 * trunc (months_between (d2, d1)) + LESS (extract (day of d2), 30)-LESS (excerpt (d1 day), 30)

    + CASE when extracted (d2 day)< extract(day="" from="" d1)="" then="" 30="" else="" 0="" end ="">

    d

    D1 D2 DAYSBETWEEN

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

    October 10, 2013 5 December 2013 56

    March 1, 2013 30 March 31, 2013

    5 February 2013 March 31, 2013 56

    February 25, 2013 March 23, 2013 29

    February 25, 2013 March 31, 2013 36

    August 2, 2013 29 October 2013 88

    February 1, 2013 may 31, 2013 120

    August 25, 2013 03 - Sep-2013 9

    July 30, 2013 31 August 31, 2013

    July 31, 2013 August 30, 2013 31

    July 31, 2013 3 August 2013 4

    July 3, 2013 August 31, 2013 58

    31 August 2013 5 October 2013 36

    5 February 2013 March 31, 2013 56

    5 February 2013 March 5, 2013 31

    February 5, 2013 February 5, 2013 1

    In my view, which corresponds to your rules.

  • get the month and year of date type

    Hi all
    I need to get the month and year of type date.

    For example
    select to_date('2011-01-17', 'yyyy-mm-dd') from dual;
    Required result:
    01-2011
    Any ideas?

    Thanks in advance,
    Bahchevanov.
    select to_char(to_date('2011-01-17', 'yyyy-mm-dd'),'mm-yyyy') from dual;
    

    HTH

  • Get the number of days in a month based on the month and year of fields

    I have a column in my form which lists the days in a month. I want to configure a hidden field that calculates the total number of days in a month, based on the month and year of the field inputs. The number of days will determine what appears on the column. For example, if I put 4 months, and 2016 in the field of the year, I get 30 in the hidden field. Thus, on the column 'Day', I'll have numbers 1-30. Or if I put 2 months and 2016 in the field of the year, I get the 29 in the hidden field. If the numbers 1-29 appears in the column 'day '.

    Found this on some forum javascript code:

    //Month is 1 based
    function daysInMonth(month,year) {
      
    return new Date(year, month, 0).getDate();
    }

    //July
    daysInMonth
    (7,2009); //31
    //February
    daysInMonth
    (2,2009); //28
    daysInMonth
    (2,2008); //29

    I do not know how to convert this code in JavaScript to adobe and don't really know how to use it. All I know how to do is to configure the field values for the field month and year as variables. I am a novice programmer and would appreciate it really all the help I can get. Thank you in advance!

    The code seems to be JavaScript and runs as needed by using the JavaScript console.

    I would like to consider making more general code, so if you have a date string that includes at least the month and year we could just call the function and get the number of days for that month.

    The following script will calculate the number of days in a month, by using at least the month and year values can display the result on the JavaScript console and all of the value field for the field that has this code as the custom calculation Script.

    function daysInMonth (oDate) {}
    return new Date (oDate.getFullYear (), oDate.getMonth () + 1, 0) .getDate ();
    }

    nMonth var = this.getField("Month").valueAsString; get the value of month;
    nYear var = this.getField("Year").valueAsString; get the value of the year;

    Event.Value = "";

    If (nMonth! = "" & nYear!) = "") {}
    var MyDate = util.scand ("' / mm/yyyy ', nMonth +" / "+ nYear); convert to date object;
    var nDaysInMonth = daysInMonth (MyDate); get the number of days;

    Console.Open (); Open the JavaScript console;

    Console.clear(); clear the console;

    Console.println ("Days in" + nMonth + ":" + nDaysInMonth); show days in month;

    Event.Value = nDaysInMonth; Set the value of the field;

    }

  • How to find the Maxima and Minima for each column of a 2D array?

    Hello

    I have a 2D chart and I would find the maxima and minima of each column of the 2-D table. Even though I know how to get maxima and minima for the whole picture but don't know how columnwise? Any ideas please?

    Thank you

    Rohit

    Hello

    @Smercurio-What you said is true, I should have shown using automatic indexing enabled which is really excellent choice. I just tried to show in a very simple way.

    Anyway, here's the best way

  • How to find the utilities and windows drivers VGN-CR36G 8?

    Hello

    I use laptop Vaio VGN-CR36G with vista ultimate. Now, I want to install windows 8 enterprise edition.

    But I can't find the drivers and utilities on the site of sony vaio.

    But my product is compatible for windows 8 OS.

    Here is the link below:

    http://www.Sony-Asia.com/support/product/VGN-CR36G

    Can someone please help me to download all drivers and software?

    Thank you

    Hi Whiteeasy.

    This model does not support Windows 8 operating system which you can confirm from the link below.

    http://www.Sony-Asia.com/microsite/VAIO/support/GetWindows8/GetWindows8_EN_NA.html?referer=http%3A%2...

    If my post answered your question, please mark it as an "accepted Solution".

  • How to find the maximum and minimum of a waveform between cursors

    Hello!

    Does anyone know an easy way to find the maximum and minimum of a waveform between two sliders?

    Kind regards

    Andreas

    Hi Andreas,

    attached, you get an example of it in MeasurementStudio.

  • to get the month and year separated

    Hello

    I have the entry_date_fin of column (type of data-varchar2 (8))

    with values like Apr.-2008
    Feb-2009 etc.

    can I get the distinct month and year separated
    i tried select to_date(entry_date_fin,'MM') FROM  xyz  doesnt wrk
    kindly guide me

    Although you are (wrongly, IMO) storage of dates as strings, just use string manipulation...

    SQL> with t as (select 'FEB-2008' as txt from dual)
      2  --
      3  select substr(txt,1,3) as mnth
      4        ,substr(txt,5) as yr
      5  from t
      6  /
    
    MNT YR
    --- ----
    FEB 2008
    
    SQL>
    
  • Hide the 0 before the month and year

    I m using this query to generate the sequence
         SELECT     TO_CHAR (SYSDATE, 'MM')
                             || TO_CHAR (SEQ.NEXTVAL)
              || TO_CHAR (SYSDATE, 'YY')
              
          FROM   DUAL;
    The result is
    0612109
    06 is the month
    121 is the sequence
    09 is the year

    I want to hide 0 before the month and the year also.

    Looks like this

    * 61219 *.
    if here Month is 10 and year is 2010
    
    then It will display
    1021110
    

    Try this

    SQL> SELECT     ltrim(TO_CHAR(to_date('12-10-2010','dd-mm-yyyy'), 'MM'),'0')
      2       || TO_CHAR (SEQ.NEXTVAL)
      3            || ltrim(TO_CHAR (to_date('12-10-2010','dd-mm-yyyy'), 'YY'),'0') format_date
      4           FROM   DUAL;
    
    FORMAT_DATE
    --------------------------------------------
    1026010
    
  • Always backup failed. due to files corrupted. Error message 0x800703F9.How to find the file and fix them?

    Last backup completed in September - how can I save now please

    Hello
     
    1. you remember to make changes to your machine before the problem?
    2. you have any third-party backup utility installed on your computer?
    3. What are you trying to backup?
    4. that you make a system image backup?
     
    Try another backup file and check.
     
    Follow the steps and check if that helps.
     
    Step 1:
     
    I suggest that you run SFC analysis and check if the problem is related to the file system damaged or missing.
     
    Step 2:
     
    Check your hard drive for errors
     
    Warning of Chkdsk.
    Important:
    when running chkdsk on the drive hard if bad sectors are found on the disk hard when chkdsk attempts to repair this area if all available on which data may be lost
     
    Aziz Nadeem - Microsoft Support

    [If this post was helpful, please click the button "Vote as helpful" (green triangle). If it can help solve your problem, click on the button 'Propose as answer' or 'mark as answer '. [By proposing / marking a post as answer or useful you help others find the answer more quickly.]

  • How to find the lock and kill session in order to release it?

    Hi all

    EBS R12.2

    "I met ' could not book record" in our case. How to release the session locked?

    I usually do this by bouncing the apps & db level. Is their subtle way?



    Capture.PNG



    Kind regards

    JC



    Ideally, you should check for locks on the table in question where records are trying to access.

    AFAIK, you must check the v$ locked_object and find sessions.

    Hope this helps!

    Kind regards

    Hugues

  • How to find the version and the arc of the installed Oracle client

    Hi all

    I have a sles 10 sp2 x86_64 on which customer oracle 10.2 is installed. This facility has not been made by me!
    so I don't know how the oracle client version/architecture (32/64-bit) is installed on the client.

    of sqlplus v I get only the version that is installed, and not if it is 32 or 64 bit. How can I find that.

    sqlplus v
    SQL * more: Release 10.2.0.1.0 - Production

    with a little research on Google I found that the link that says 10g below client 32-bit cannot be installed on a 64-bit system.

    I read this Client 32-bit installation on Linux x86_64 RDBMS software. [1075717.1 ID]
    Installing 32-bit RDBMS Client software on x86_64 Linux.
    The only release of 32-bit RDBMS Client software that will properly install on an x86_64 Linux OS system is 11gR2 (aka 11.2.0.x)
    
        * 9iR2 (aka 9.2.0.x) 32-bit RDBMS Client software will NOT install on any x86_64 Linux OS system.
        * 10gR1 (aka 10.1.0.x) 32-bit RDBMS Client software will NOT install on any x86_64 Linux OS system.
        * 10gR2 (aka 10.2.0.x) 32-bit RDBMS Client software will NOT install on any x86_64 Linux OS system.
        * 11gR1 (aka 11.1.0.x) 32-bit RDBMS Client software will NOT install on any x86_64 Linux OS system.
    
    The answer to "why", is that the 11gR2 Client software is the first version that includes syntax so that a 32-bit object is linked.
    can anyone please shed more light on this?

    Hello

    PL see TechNote MOS:
    * How to find if the Oracle Client Software is 32-bit or 64-bit platforms UNIX [434295.1 ID] *.

    Thank you
    A H E E R X

  • How to find the lock and more information why the prg conc taking too long

    Oracle Apps R12-Orader management

    Hi all

    I am new to Oracle Apps, we I run my simultaneous program
    its taking too long to complete. How to find that there is a lock to produce in the table while that simultaneous execution of the program, another way to find why the simultaneous program takes too long to run and how can you speed up the process.

    Yesterday we made a few changes to speed up the process with our DBA to accelerate the simultaneous program

    The first simultaneous program takes 2 h 30 and after these changes taking 1 h 45. Please suggest it's okay

    Connected with the responsibility of the system administrator.

    Manager - set - Manager of the standard.

    Set the value of PROCESS like 15 (instead of 10).

    Set the value of SECONDS of SLEEP as 10 (Changed from 30).

    Manager - set - Manager2 Standard.

    Set the value of PROCESS like 15 (instead of 10).

    Set the value of SECONDS of SLEEP as 10 (Changed from 60).


    Any suggestion on how to find why it takes too much time.

    Any help is highly appricatable

    Thanks and greetings
    Srikkanth.M

    Hello

    I suggest you draw the simultaneous program and analyze the trace file. To do this, mark the simultaneous program as Trace enable (RESP system administrator, Menu simultaneous > program > define) and then run the program and download the trace file after dealing with tkprof. Check which are the staements who take most of the time and try to optimize them.

    It will be useful.

  • How to find the computer and hostname to get remote access?

    Original title: remote access
    Where I would look for a hot name and cmputer get remote access.

    Hello

    Follow these steps to find the name of your computer:

    1. open system by clicking the Start button, click Control Panel, clicking system and Maintenance, and then click System.
    2. under name computer, domain, and workgroup settings, you can find your computer name and the full name of the computer if your computer
    is in a domain.

    Refer to this link for help:

    The name of your computer:
    http://Windows.Microsoft.com/en-us/Windows-Vista/find-your-computer-name

    You can also visit these links for more information about the remote desktop connection:

    Connect to another computer using Remote Desktop connection:
    http://Windows.Microsoft.com/en-us/Windows-Vista/connect-to-another-computer-using-Remote-Desktop-connection

    Remote Desktop connection: frequently asked questions:
    http://Windows.Microsoft.com/en-us/Windows-Vista/Remote-Desktop-connection-frequently-asked-questions


    Kind regards
    Afzal Taher-Microsoft Support.
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • How to find the object and remove from the WordPress site.

    There is a search form that appear on each page. It is just below the entrance by the WP user content for each page.

    I've been using Firebug in Firefox and I can see the code it puts in Firebug, but I can't find the source file so that I can change the code using DW to remove this search form.

    Please help if you can.

    I found it. It is searchform.php and she is called to sidebar.php where the other widgets are called from.

    I hope this helps someone else.

    Thanks for your help Nancy OShea

Maybe you are looking for

  • Repeat functions

    I have a function A and I stated that this function. I would like this feature to repeat itself For example,. I have 2 buttons called B and C When the user clicks on B A c and when the user click on do A and C I want to just write the code for the fu

  • Satelite L300D begins

    Hey guys, I have a big problem, my Toshiba L300D begins!I turn it on and it turns on the led lights (power, batery etc.), but just nothing on screen.The fan works, the HARD drive starts.The screen remains black. Pleas help me!

  • Is it possible to simply add a playlist iTunes game and not everything in iTunes?

    I just signed up for iTunes game but do not want to put all my music in the cloud. Is it possible to add to a playlist? If I choose the music is downloaded?

  • 5532e wanted: print queue

    All the functions of the printer works but does not queue the form print. Used print doctor said it had fixed the problem of the print queue but will not work.

  • Broken LCD - can not get external display

    My screen is no longer good so im trying to connect an external display. Been trying for hours to try to get the external display to work to boot. Ive tried 2 sets of hd and svga cables change everything. The function key. The laptop does not recogni