How to know the difference between the Dates in Oracle.

Hello

Suppose we have two Dates say November 5, 2005 and October 12, 2007.

Is it possible to know the total difference between these Dates in Oracle.

Thank you

You can subtract date-objects. The result is the difference in days.

select  to_date('12-10-2007','DD-MM-YYYY') -  to_date('05-11-2005','DD-MM-YYYY')   from dual;

In your example: 706 days

Published by: hm on 25.10.2010 12:33

Please look also for "Oracle Date arithmetic" in the Oracle Documentation or Google.

Tags: Database

Similar Questions

  • How to know the date of manufacturing

    Hello!

    Can you tell me how to find out the date of manufacture of my Satellite A110-334 with the series 'SY6224123K '?
    I need this information for my insurance!

    I found only this link to disk: http://www.storage.toshiba.eu/index_manual.php?pid=220&sid=536&la=en

    But there is no "S" on the first digit!

    So it is perhaps "Y6" which can be November 2006! Is this good?

    Thank you!

    ===========
    This is the information on the link above:

    How to encode a Toshiba hard drive serial number?
    Toshiba serial number (S/N) includes the date of manufacture. The first digit of the serial number indicates the month of manufacture and the 2nd digit is the year.

    Example:
    M Y x x x x x x x
    M = month
    Y = year

    Data for the month goes from 1, for January, by 9 in September, then X, Y and Z, for October, November and December.

    Examples:
    2 8 1 7 0 0 0 1
    2 = February
    8 = 1998

    3 0 5 4 4 3 0 6 T
    3 = March
    0 = 2000

    X 9 7 8 3 3 1 T
    X = October
    9 = 1999

    The remaining digits contain information about the plant and the production line, and some numbers are reserved for a continuously running serial number.

    Hello

    Try with http://gedb.toshiba.com/

    Let me know if you find the info you need.

  • How to know the date Acual shipping in the sales order

    Hello
    I want to know the actual shipping date on command.
    please me hepl
    Thank you
    REDA

    917419 wrote:
    Hello
    I want to know the actual shipping date on command.
    please me hepl
    Thank you
    REDA

    Go to the line which is shipped--> take action for additional online information... go to the delivery tab to see the dates of departure and arrival

    HTH
    Mahendra

  • How to know the date of the created table

    Hello
    How will I know when a table has been created in oracle 9i and 10g.

    thxs
    select created from dba_objects
    where object_name = 'tablename';
    

    - - - - - - - - - - - - - - - - - - - - -
    Kamran Agayev a. (10g OCP)
    http://kamranagayev.WordPress.com

  • How to know the name of the file in the file/FTP adapter

    IAM again at the file/FTP adapter,

    whenever we use files by ftp/adpter,

    afrter choose system of remote/local server file.

    How I can well filename?

    How can we handle a fault, if the file selected, but the data is wrong?

    How to know the date, when where selected file?

    Please give me the solution

    Check this: http://docs.oracle.com/cd/E25178_01/integration.1111/e10231/adptr_propertys.htm#CHDJBDHC

    Search this topic: properties of table A-5 JCA for Oracle file adapter: standard properties.

    Once the file has been picked up, you can easily extract the details of file using "jca.file.FileName" etc. (see above).

    Rest should be treated by you, depending on the scenario you have.

    HTH

  • How to find the difference between two dates in the presentation layer

    Hi gurus,

    Hello to everyone. Today, I came with the new requirement.


    I need to know the difference between a date and the current date in the formula column application presentation layer.by.



    Thank you and best regards,
    Prates

    Hi Navin,

    TIMESTAMPDIFF function first determines the timestamp component that corresponds to the specified interval setting. For example, SQL_TSI_DAY corresponds to the day component and SQL_TSI_MONTH corresponds to the component "month".

    If you want to display the difference between two dates in days using SQL_TSI_DAY, unlike butterflies SQL_TSI_MONTH and so on...

    hope you understand...

    Award points and to close the debate, if your question is answered.

    See you soon,.
    Aravind

  • How to calculate the difference between a Date column and the Date yesterday in the analysis (in the formula in the column)

    . For example, I need to calculate the difference between a date column, 'Table_Name '. "' Column_Name ' and (Current_Date-1). I tried different ways to do this. But nothing seems to work.

    Try the below formula.

    Replace "Time". "" Date "with your column.

    TIMESTAMPDIFF (SQL_TSI_DAY, "Time". "Date", TIMESTAMPADD (SQL_TSI_DAY-1, CURRENT_DATE))

    Thank you!

  • How do the time difference between two dates?

    Hi all

    I use this query to get the time difference between two dates.

    Select to_timestamp ('2012-10-03 12:00 ',' YYYY-MM-DD hh)-to_timestamp ('2012-10-03 11:00 ',' YYYY-MM-DD hh) as double diff;

    but do not get the correct result.

    Thank you

    Left KEY... Left Padding of tanks.

  • difference between two dates in the year/month/day in Obiee

    Hi gurus,

    I know this question have been asked and answered several times but I have a requirement that is a little different, then the previous ones.

    I want to calculate the difference between two dates in OBIEE10g in year/month/day format similar to the below SQL output

    SQL > select end_date, start_date,

    trunc (months_between (end_date, start_date) / 12) years.

    months of mod (trunc (months_between (end_date, start_date)), 12).

    End_date - add_months (start_date, trunc (months_between (end_date, start_date))) days

    t

    Thanks in advance

    SK

    Search for this

    "TIMESTAMPDIFF IN THE FORM OF MTHS # YEARS."

    or else

    To get the current mandate of employees since the date of hiring in the form of # years # mths or # year (s) # month (s)

    Concat (concat (cast (TIMESTAMPDIFF (SQL_TSI_Month, "Employee attributes". (((' ' Hiring last Date employee ", CURRENT_DATE) / 12 as char),"Year (s)"), concat (cast (MOD (TIMESTAMPDIFF (SQL_TSI_Month,"Employee attributes". (((((' ' Hiring last Date employee ", CURRENT_DATE), 12) as char), 'Month (s)'))

    Concat (concat (CAST (TIMESTAMPDIFF (SQL_TSI_YEAR, "Employee attributes". (((' ' Hiring last Date employee ", CURRENT_DATE) as CHAR),"Year (s)"), concat (cast (MOD (TIMESTAMPDIFF (SQL_TSI_Month,"Employee attributes". (((((' ' Hiring last Date employee ", CURRENT_DATE), 12) as char), 'Mth (s)'))

  • How do I know the date purchased in the macbook pro?

    How do I know the date purchased in the macbook pro?

    The date of the purchase of a MBP will on reception, not in the MBP.

    Ciao.

  • Anyone know how to check the date of warranty until when?

    Anyone know how to check the date of warranty until when?

    https://checkcoverage.Apple.com/Jo/en/;JSESSIONID=9pJ0X9pFPJtNg3c44yDGCvk9pVpt5l QSgn4B60y4Skv1WfmnqMkF!-1840326800

  • How can I know the date of my current windows installation?

    How can I know the date of my current windows installation?

    Start - All Programs - Accessories - right on command prompt and choose run as administrator. Type (or copy and paste by clicking in the command prompt window and choose Paste).
     
    SystemInfo | more
     
    It is up.
  • Does anyone know how to change the date of the capture of several images with LR CC?

    Does anyone know how to change the date of the capture of several images in LR CC

    Hi Jguy,

    Please see this thread time changing capture several Images on

    Let us know if this helps

    Kind regards

    Assani

  • Find the difference between two date and time

    Hi friends,

    I wanted to find the difference between two date and time, but my qury is slightest error "invalid number."

    select sql_step_num,proc_name,run_seqno,start_date,end_date,(to_char(start_date,'HH24-MI-SS') - to_char(end_date,'HH24-MI-SS') ) as ed  
    from eval.EVAL_RUNTIME_DETAILS
    where trunc(start_date) = trunc(sysdate) 
    order by sql_step_num;

    You try to get the feel between two char strings.
    And more difference between two dates gives a NUMBER of days.
    Try this:

    select sql_step_num,proc_name,run_seqno,start_date,end_date,numtodsinterval(end_date-start_date,'DAY') as ed
    from eval.EVAL_RUNTIME_DETAILS
    where trunc(start_date) = trunc(sysdate)
    order by sql_step_num;
    
  • How do I know the date when an oracle database is improved

    Hello

    I would like to know the date when an oracle database is upgraded (for example 10.2.0.4 to 11.2.0.3).

    Can you help me find these details.

    Thank you

    Delphine

    To be more precise, you can query

    Select to_char (ACTION_TIME,'MON-DD-YYYY ""), the SUBMISSIONS in ACTION, ID, VERSION, BUNDLE_SERIES, of DBA_REGISTRY_HISTORY where ACTION = 'upgrade ';

    Example:

    SQL > select to_char (ACTION_TIME,'MON-DD-YYYY ""), the SUBMISSIONS in ACTION, ID, VERSION, BUNDLE_SERIES, of DBA_REGISTRY_HISTORY where action = 'upgrade ';

    TO_CHAR (BILL ACTION VERSION ID BUNDLE_SERIES COMMENTS

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

    6 March, 2009 UPDATED 10.2.0.4.0 improved 10.2.0.3.0

Maybe you are looking for

  • Read emails disappear from the Inbox when I return to the Inbox

    If 'Read' Emails are left in the "Inbox" and then I leave this folder, move it to another folder and return to the "Inbox" only "unread" e-mail is visible. All 'Read' previously in the "Inbox" emails have disappeared - I can't find them in any folder

  • Can you install a Mac os on a windows machine 7?

    Can MAC os can be installed in the system where windows 7 is already their?

  • Windows Media Player 11 says cd is "filled".

    Whenever I insert a blank cd in my drive, the bar that shows how much room is left on the disk fills with red and says 'filled '. I know that the cd I am inserting are empty. I tried to see if there are updates, and the answer is no update. What shou

  • Data corrupted on Easy Transfer CD

    Hello, I'm running a problem trying to open my CD easy to transfer to my new computer. I put all the files from the old computer on several CD and now when I put the first disc in, Easy Transfer charges almost all of it but then I get this message: "

  • Impossible to uninstall McAfee SpamKiller

    I can't get my McAfee SpamKiller go - disable or uninstall.  I used to have, it has expired and I don't want to come back.  The rest of my Security Center is always current (not expired) and I don't want to get rid of it. In Add/Remove Programs, it i