O'Reilly logo

Oracle SQL and PL/SQL Handbook: A Guide for Data Administrators, Developers, and Business Analysts by John Adolph Palinski

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Date Functions

Oracle has a number of functions that are used with dates. You have already seen the TO_CHAR function used to change the format of the date. Other functions exist to compute dates or to determine the months between dates. Table 7.3 lists the date functions.

The ADD_MONTHS Function

The ADD_MONTHS function is used to compute a new date based on a specified number of months. The function enables you to determine a more accurate date than simply adding a number of days to the target date. Errors can occur in date arithmetic if the computed date occurs in a year that is different from the target date. This function is better than straight arithmetic because it is not affected by leap years.

Table 7.3. Date Functions
Function Name ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required