Add a date to decimal number

hello
pls tell me how to add a date to decimal number as
4 years and 3 months for example ?
EX.
===
1/1/2001
+
4 years and 3 months
Regards,
Abdetu...

If you want a specific result, then post your desired result...we don't know your desired format mask.
In case it's yyyymmdd:
SQL> select to_date('1/1/2001', 'dd/mm/yyyy') dt
  2  ,      add_months(to_date('1/1/2001', 'dd/mm/yyyy'), 51) dt2
  3  ,      to_number(to_char(add_months(to_date('1/1/2001', 'dd/mm/yyyy'), 51), 'yyyymmdd')) num
  4  from   dual;
DT                  DT2                        NUM
01-01-2001 00:00:00 01-04-2005 00:00:00   20050401
1 row selected.

Similar Messages

  • Aperture cannot add GPS data to multiple images at the same time

    I am new to Aperture and have been using it for a week or so now. Today I tried to add GPS data to a number of images and found out, it appears Aperture can only add GPS data to one image at the time. When I select multiple images to add the GPS data to, it just doesn't do anything. It leaves the GPS data blank.
    Here is what I do:
    From the Info-tab I select "GPS" from the drop down menu
    At the bottom of the info tab I show the map
    In the map's search box I enter the location I want to assign to the photo(s)
    From the resulting drop down menu I select the locatiion I want and press the "assign to location" button
    As long as I choose only a single image, this works fine and the GPS Data is added. Not so when I select more than a single image. After pressing the "assign to location" button it seems as if the GPS data is added (there is no message indicating otherwise), but the GPS data in the selected images is blank.
    What am I doing wrong ?
    Additional info
    I have been testing this a bit more and the behavior is even more strange: When you select multiple images in Aperture, they get a thin white border, except the one that you touch last (normally the last image of the selection) that will have a thicker border around it. It appears that, when selecting multiple images, the GPS data is ONLY assigned to the photo in the selected setthat has the thicker border (?????)
    Message was edited by: dinky2

    Rereading your post, I think the problem is, that you are assigning the location from the Info panel and not from the Metadata menu. The Info panel and the Metadata menu ar behaving differently.
    The Info panel will always only affect the primary selection, but the Metadata menu will work on all selected images (unless "Primary only" is checked). So , if you want to assign your location to multiple images, use "Metadata > Assign location" instead of the little map in the "Info" panel.
    Or use the "Places" view. Then you can drag all images at once to the same pin on the map.
    Regards
    Léonie

  • How to convert data read in byte to decimal number?

    The following are a source code to read from a serial port, but i can't convert the data that i read to decimal number and write it on a text file.....can anyone kindly show me how to solve it? thanks
    import javax.comm.*;
    import java.io.*;
    import java.util.*;
    public class Read implements Runnable, SerialPortEventListener {
         // Attributes for Serial Communication
         static Enumeration portList;
         static CommPortIdentifier portId;
         SerialPort serialPort;
         static OutputStream outputStream;
         InputStream inputStream;
         Thread readThread;
         public static void main(String s[])
         portList=CommPortIdentifier.getPortIdentifiers();
         while(portList.hasMoreElements())
              portId=(CommPortIdentifier)portList.nextElement();
              if(portId.getPortType()==CommPortIdentifier.PORT_SERIAL)
                   if(portId.getName().equals("COM1"))
                        System.out.println( portId.getName());
                        Read ss=new Read();
              }     // end of while
    }          // end of main
    public Read()     {
    try{
              serialPort=(SerialPort)portId.open("Read", 2000);
    catch(PortInUseException e)     {}
         try{
              inputStream=serialPort.getInputStream();
              System.out.println(inputStream);
    catch(IOException e)     {}
         try{
              serialPort.addEventListener(this);
    catch(Exception e)     {}
              serialPort.notifyOnDataAvailable(true);
         try{
              serialPort.setSerialPortParams(9600,
              SerialPort.DATABITS_8,
              SerialPort.STOPBITS_1,
              SerialPort.PARITY_NONE);
              }catch(UnsupportedCommOperationException e)     {}
              readThread=new Thread(this);
              readThread.start();
         }//end of constructor
         public void run()
              try     {
                   Thread.sleep(200);
              }catch(InterruptedException e)     {}
         public void serialEvent(SerialPortEvent event)
              switch(event.getEventType())
                   case SerialPortEvent.BI:
                   case SerialPortEvent.OE:
                   case SerialPortEvent.FE:
                   case SerialPortEvent.PE:
                   case SerialPortEvent.CD:
                   case SerialPortEvent.CTS:
                   case SerialPortEvent.DSR:
                   case SerialPortEvent.RI:
                   case SerialPortEvent.OUTPUT_BUFFER_EMPTY:
                   break;
                   case SerialPortEvent.DATA_AVAILABLE:
                   byte[]readBuffer=new byte[8];
                   try{
                        while(inputStream.available()>0)
                             int numBytes=inputStream.read(readBuffer);
                             //System.out.println("hello");
                        System.out.print(new String(readBuffer));
                        }catch(IOException e)     {}
                   break;
                   }     // end of switch
                   try     {
                        inputStream.close();
                        }catch(Exception e5)     {}
         }          // end of serialEvent

    Is it a float or a double?
    For a float, the decimal should be 4 bytes (small numbers like 1.1 start with the byte 0x40). Convert these 4 bytes to an int, using byte-shifting would probably be easiest.
    int value = ((b3 << 24) + (b2 << 16) + (b1 << 8) + b0);//b# are bytesNow to convert it to a float, use
    Float.intBitsToFloat(value);Now if you want double percision, You will have 8 bytes instead of 4, and need to be converted to a long instead of an int through byte-shifting. Then use Double.longBitsToDouble(long bits) to get the double

  • We can't add a decimal number column with the create table forms

    In the version 4, we can't add a decimal number column with the create table forms.

    In the GUI, I found the following column (I translate from french to english): PK, Name, Data_type, lenght, not null, default, comments.
    In the lenght field, if I enter 9,3 to have a NUMBER(9,3), I have a message saying that the number must be an integer.

  • Format a decimal number to percentage form, e.g. 0.01 to 1%

    Hi all,
    As titles, i want to format a decimal number to percentage form, e.g. 0.01 to 1%. I can't find it in PQ.
    Thanks,
    Arthur
    Keep involved!

    PQ doesn't currently have a way to specify number formats (that's usually done in Excel after filling the data to the sheet, or in Power Pivot). But if you want to generate some text that represents a number as a percentage, you can use this formula:
    = Text.From(TheNumberYouWantToFormat * 100) & "%"
    Ehren
    Any plans to add this functionality in the future?
    Keep involved!

  • HOW DO I ADD A DATE IN THE FOOTER?

    I can not find the INSERT DATE function to add a DATE to the footer of a NUMBER spreadsheet.  How do I do that? 

    Bob,
    Further to Jerry's pointer, see this thread for a description of how you can set up an 'insert date' pick in your menu.
    If you want (thanks to Badunit for showing that this was possible) instead of going through the steps described there you can just grab a copy of the service via this link (automatic download from Dropbox).  When you doubleclick it, you'll be asked if you want to install it. You may have to go to System Preferences > Security & Privacy to click 'open anyway' if you get a warning message.
    That's it. After it's installed it will be a menu pick similar to the screenshot above.
    If you want to rename it, then in Finder hold down the option key choose Go in the menu, navigate to Library > Services and rename it there as you would any other file.
    If you don't like going to the Services menu then assign a keyboard to it at System Preferences > Keyboard > Shortcuts.
    SG

  • How to add one date column and charecter column

    hi all,
    i have 3 column start_date(date),end_date( date),duration (varchar2)
    i am trying to add start_time and duration like this
    end_date := to_char(start_time) + duration;
    but its showing value_error
    how to add one date column and charecter column.
    Thanks

    you need something that does:
    end_date (DATE) := start_date (DATE) + <number of
    days> (NUMBER)Not necessarily, because if the duration is just a string representation of a number then it will be implicitly converted to a number and not cause an error
    e.g.
    SQL> ed
    Wrote file afiedt.buf
      1  with t as (select to_date('01/07/2007','DD/MM/YYYY') as start_dt, '3' as duration_days from dual)
      2  -- END OF TEST DATA
      3  select start_dt + duration_days
      4* from t
    SQL> /
    START_DT+
    04-JUL-07

  • Is it possible to add the date to the notifications center?

    im using the new iphone 5 and was wondering if its possible to add the date to the notification center?  i know the date shows up when you have an event scheduled.

    The photo in the calendar replaces the date. You can ctrl-click the photo and add a caption to show the day number.
    Clicking the disclosure triangle to the right of the caption will show a panel where you can edit the font (all this tested in iPhoto 9.5.1), but it does look funny, you'd be better off by not adding the day number:

  • I can't use a decimal number in a update routine

    Hi,
    I want to use a decimal number in a udate routine (in a updating rule). I've a code similar to this:
    IF COMM_STRUCTURE-/BIC/ZSATIAUX1 LT 1,5.
      RESULT = 'GOOD'.
    And when I save the routine I get the following error:
    E:Comma without preceding colon (after IF ?).
    The COMM_STRUCTURE-/BIC/ZSATIAUX1 field is numeric field with three decimal positions.
    Can anybody tell me why I can't use decimals in my routine?
    Thanks in advance.
    Regards.

    Hi,
    Try following code:
    Data: Val type COMM_STRUCTURE-/BIC/ZSATIAUX1 .
    val = 1.5.
    IF COMM_STRUCTURE-/BIC/ZSATIAUX1 LT val.
    RESULT = 'GOOD'.
    endif.
    Regards,
    Geetanjali

  • Where are the facilities to add custom date ranges, indexable by Spotlight

    The Finder is meant to be just that... A way to find files right?
    Well lets look at a simple business scenario. I get a bill from a supplier, I pay the bill, I receive an invoice, I process the invoice through my accounting package. Now with paperless offices these days bills and invoices come electronically or are scanned electronically.
    While iTunes mp3s are able to be categorised by custom date ranges such as when the album was released why cant I find files based on custom date ranges such as "Date Paid", "Date Due", "Date Received". I cant find any solution for this anywhere. There are many file tagging systems out there such as Yep and Tags which are meant to be using OpenMeta... But all they enable you to do is tag them by commonly used key words such as "Invoice" or "Bill". What if I want a custom field to put an Invoice number so that I can track it down using spotlight?
    This would enable me to completely manage my office files in one clean sweep. I cant be the only one out there would would find this solution useful... Is it the case that spotlight/finder is designed in such a way that it is not possible to add custom date meta data?

    {quote}
    What if I want a custom field to put an Invoice number so that I can track it down using spotlight?
    Why wouldn't you just type in the Invoice number and have spotlight find it for you? Spotlight indexes all of the text in most type of documents. In my case, I use some Excel spreadsheets, with unique invoice numbers. I type in the number and Spotlight shows the document.
    I can also type in the clients name and be shown a list of all the documents, emails, etc to or from or that mention that client. Included in the list of documents is every invoice that has that clients name in the text of the document.
    If I'm looking for a particular invoice and know the clients name I type it and also something about the particular invoice that I'm looking for (like "John Smith video card") and that invoice shows up in the search.
    If I'm looking for an invoice for a certain person during a certain year I just type: John Smith 2010 and those documents show up in the list at the top.

  • How to add appointment date into CRMD_ORDER TCODE

    Hello i am trying to add 3 dates into the appointment area of the TCODE CRMD_ORDER,i am making this action into de BADI ORDER SAVE, and depents of a specific date of the TCODE i make the 3 differs dates after that ,i fill the input fields tables and of course the appointment tables too, after of that i call the function module CRM_ORDER_MAINTAIN and i send the both table to the this Fucntion module, and when go out of the ORDER_SAVE BADI i am expecting to have the result into the CRMD_ORDER TCODE, but i coudn´t save these dates. (in this example i send only one date)
    InputFields
    ls_input_field-ref_handle = lv_handle_h.
    ls_input_field-ref_guid = iv_guid. "Guid del Documento
    ls_input_field-ref_kind = 'A'.
    ls_input_field-objectname = 'APPOINTMENT'.
    ls_input_field-logical_key = 'ZV01'. "Indica que la fecha es Presentacion de proyecto
    ls_fielname-fieldname = 'DOMINANT'.
    ls_fielname-changeable = 'X'.
    INSERT ls_fielname INTO TABLE ls_input_field-field_names.
    ls_fielname-fieldname = 'DURATION'.
    ls_fielname-changeable = 'X'.
    INSERT ls_fielname INTO TABLE ls_input_field-field_names.
    ls_fielname-fieldname = 'RULE_NAME'.
    ls_fielname-changeable = 'X'.
    INSERT ls_fielname INTO TABLE ls_input_field-field_names.
    ls_fielname-fieldname = 'SHOW_LOCAL'.
    ls_fielname-changeable = 'X'.
    INSERT ls_fielname INTO TABLE ls_input_field-field_names.
    ls_fielname-fieldname = 'TIMESTAMP_FROM'.
    ls_fielname-changeable = 'X'.
    INSERT ls_fielname INTO TABLE ls_input_field-field_names.
    ls_fielname-fieldname = 'TIMESTAMP_TO'.
    ls_fielname-changeable = 'X'.
    INSERT ls_fielname INTO TABLE ls_input_field-field_names.
    ls_fielname-fieldname = 'TIMEZONE_FROM'.
    ls_fielname-changeable = 'X'.
    INSERT ls_fielname INTO TABLE ls_input_field-field_names.
    ls_fielname-fieldname = 'TIMEZONE_TO'.
    ls_fielname-changeable = 'X'.
    INSERT ls_fielname INTO TABLE ls_input_field-field_names.
    ls_fielname-fieldname = 'TIME_UNIT'.
    ls_fielname-changeable = 'X'.
    INSERT ls_fielname INTO TABLE ls_input_field-field_names.
    INSERT ls_input_field INTO TABLE et_input_fields.
    appointment table
    wa_appointment-ref_guid = iv_guid.
    wa_appointment-ref_kind = 'A'.
    wa_appointment-timezone_from = 'CST'.
    wa_appointment-timestamp_to = '0'.
    wa_appointment-timezone_to = 'CST'.
    wa_appointment-appt_type = 'ZV01'.
    wa_appointment-timestamp_from = lv_timestamp.
    APPEND wa_appointment TO it_appointment.
    CALL FUNCTION 'CRM_ORDER_MAINTAIN'
    EXPORTING
    it_appointment = it_appointment
    CHANGING
    ct_input_fields = it_input_fields
    EXCEPTIONS
    error_occurred = 1
    document_locked = 2
    no_change_allowed = 3
    no_authority = 4
    OTHERS = 5.
    IF sy-subrc 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    So does anybody have any idea how to make this?
    Thanks a lot for you help.

    You can modify the following coding which is working fine for me...
      ls_field_names-fieldname = 'DOMINANT'.
      INSERT ls_field_names INTO TABLE lt_field_names.
      ls_field_names-fieldname = 'DURATION'.
      INSERT ls_field_names INTO TABLE lt_field_names.
      ls_field_names-fieldname = 'RULE_NAME'.
      INSERT ls_field_names INTO TABLE lt_field_names.
      ls_field_names-fieldname = 'SHOW_LOCAL'.
      INSERT ls_field_names INTO TABLE lt_field_names.
      ls_field_names-fieldname = 'TIMESTAMP_FROM'.
      INSERT ls_field_names INTO TABLE lt_field_names.
      ls_field_names-fieldname = 'TIMEZONE_FROM'.
      INSERT ls_field_names INTO TABLE lt_field_names.
      ls_field_names-fieldname = 'TIME_UNIT'.
      INSERT ls_field_names INTO TABLE lt_field_names.
          CLEAR lt_appointment.
          ls_appointment-ref_handle = '0000000001'.
          ls_appointment-appt_type = 'REQ_DLV_DATE'.
          ls_appointment-ref_kind = 'A'.
          ls_appointment-ref_guid = <lf_order_data>-guid.
          ls_appointment-timestamp_from = lv_timestamp.
          ls_appointment-timezone_from = sy-zonlo.
          APPEND ls_appointment TO lt_appointment.
          CLEAR ls_input_fields.
          ls_input_fields-ref_guid = <lf_order_data>-guid.
          ls_input_fields-ref_kind = 'A'.
          ls_input_fields-ref_handle = '0000000001'.
          ls_input_fields-objectname = 'APPOINTMENT'.
          ls_input_fields-logical_key = 'REQ_DLV_DATE'.
          ls_input_fields-field_names = lt_field_names.
          INSERT ls_input_fields INTO TABLE lt_input_fields.

  • How to convert fractional decimal number to hex number?

    Hi,
    Can any one help me to convert the fractional decimal number to its equivalent hex number and vice versa ?
    if u have any code please share.
    thanks
    neethu

    neethukk wrote:
    Can any one help me to convert the fractional decimal number to its equivalent hex number and vice versa ?
    if u have any code please share.
    This question is not clear at all.
    "Fractional decimal" is not a data type, but a way of formatting in readable form using numeric characters and a decimal separator.
    Same to "hex number", but only for integers.
    What do you mean by "convert"? Do you want to keep the value the same or retain the bit pattern of the numeric data type?
    Hexadecimal is for integers. Are you talking about fixed point?
    We clearly need significantly more information. What are the input and output data types? What are you actually trying to do?
    Do you have an example input and corresponding output?
    LabVIEW Champion . Do more with less code and in less time .

  • Add the Date

    Hi!!
    I am using jdeveloper 11.1.1.5
    I had created a LegalDoc VO and dragged and dropped as af:table.,
    In that i had an Issued ON[Date Attribute],Validity [Number Attribute],Expiry [Date Attribute]
    While my user enters the Issued ON Date and Validity the Espiry should automatically generated.,
    For Eg:
    Issued On                 Validity           Freq                  Expiry            [Should be automatically generated]
    21/02/2012                3                 Days              24/02/2012 
    21/02/2012                3              Months             21/05/2012
    21/02/2012                3               Years               21/02/2015    Could any bosy pls help me to get out of this issue

    Thank you renuka!!
    I had used this method in my AMIMpl Class and i need to call this method in my ValueChangeListner
        public void ExpiryDate(){
            ViewObject vo = this.getLegalDocDetailsView1();
            Row vor = vo.getCurrentRow();
            Calendar c1;
            try {
                java.util.Date datefromtable = convertDomainDateToUtilDate((Date)vor.getAttribute("LddIssuedOn"));
                c1.setTime(datefromtable);
            } catch (SQLException e) {
                System.out.println ("Exception caught"+e);
            Number n = (Number)vor.getAttribute("LddValidDur");
            if (vor.getAttribute("LddValidFreq").equals("D")){
                c1.add(Calendar.DATE,n);   //In this i am getting error as add(int,Number) cannot invoke add(int,int) in calendar
        public java.util.Date convertDomainDateToUtilDate(Date domaindate) throws SQLException {
            System.out.println("*/*/*/*/*/*/*/*/*/");
            java.util.Date date = null;
            if (domaindate != null) {
                java.sql.Date sqldate = domaindate.dateValue();
                date = new java.util.Date(sqldate.getTime());
            return date;
        }

  • Removing leading spaces in a decimal number

    I have a decimal number field of length 28 with 9 spaces.I have to print it right justified and remove the leading spaces.I appreciate if anyone can let me the statement for this

    Hi,
      Try this..
    DATA: V_P TYPE P DECIMALS 2.
    V_P = '112.00'.
    WRITE: / V_P.
    DATA: STR TYPE STRING.
    STR = V_P.
    SHIFT STR LEFT DELETING LEADING SPACE.
    WRITE: / STR.
    Thanks,
    Naren

  • How to use "sequence" after we add new data ?

    Dear all :
    Could someone tell me how to increase the number after we add new data and put the number into one field per time ?
    Thank you

    In the Initial Value property for an item on a block, you can assign it to a sequence value. Just put the name of the sequence in the Initial Value:
    Specifies the default value that Form Builder should assign to the item whenever a record is created. The default value can be one of the following:
    Here's the part of the help screen for Initial Value that shows how to assign a sequence.
         raw value (216, 'TOKYO')
         form item (:block_name.item_name)
         global variable (:GLOBAL.my_global)
         form parameter (:PARAMETER.my_param)
         a sequence (:SEQUENCE.my_seq.NEXTVAL)
    Dave

Maybe you are looking for

  • Video Chatting and Internet Sharing at the same time.

    Does anyone know why video chat communication cannot be established while internet sharing, or how to remedy this problem by (what I imagine would be) opening/closing/redirecting a few ports? More specifically: I share my ethernet connection through

  • How to keep your old number with a new iPhone

    I find this confusing. I have an iPhone 4 with an AT&T contract. I am eligible for an upgrade and have ordered an iPhone 5 from Apple. What steps do I have to take to keep my old telephone number on the new iPhone 5? I believe this answer from AT&T i

  • GVim 7.2.368-3 cursor bug

    Hi all. After I upgraded to the latest version of Vim a couple of days ago, I started experiencing what looks like gVim cursor redraw bug. When I move the cursor in gVim, it obstructs the letter it is on: I do not experience this in plain Vim. There

  • Plugging into big screen

    ive got to sort out a 17" imac to be plugged into a PA system and big screen at an event in a couple of days..... is this possible? can i play stuff through imovie and have it show on the big screen? can i do this without anyone watching the big scre

  • Funcition module EXIT_SAPLMR1M_004 doesn't exists in ECC 6.0

    Hi, We are in the middle of an upgrade project from R/3 4.6C to ECC 6.0. Actually we have a critical business process validation in EXIT_SAPLMR1M_004 (include ZXM08U34) corresponding to enhancement LMR1M001, but in ECC 6.0 this user exit doesn't exis