How To Get Days or Months Difference Between Two Timestamp Values (Doc ID 1307900.1)

Last updated on JANUARY 24, 2016

Applies to:

Oracle TimesTen In-Memory Database - Version 7.0.0.0.0 and later
Information in this document applies to any platform.
***Checked for relevance on 04-May-2014***
***Checked for relevance on 25-Jan-2016***

Goal

The goal of this document is to show how to do day or month arithmetic on timestamp values in SQL by an example.  This applies to 7.0 and 11.2.1.x. This would also work in  11.2.2.x, however 11.2.2.x has new function called TIMESTAMPADD and TIMESTAMPDIFF (see SQL Refererence) to do timestamp arithmetic.

Solution

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms