About Date Functions

Date functions are used to manipulate values returned on date fields.

The following table provides a list of the date functions that you can use in query expressions. The Oracle Function column contains the function you will need to use if you are using an Oracle schema. The SQL Server Function column contains the function you will need to use if you are using a SQL Server database. Selecting a link in the table will open the appropriate example drop-down within this topic.

In some cases, a function cannot be expressed on both an Oracle schema and a SQL Server database. In these cases, the Oracle Function or SQL Server Function column contains an empty, shaded cell.

Description

Oracle Function

SQL Server Function
Date addition or subtraction

MI DateAdd

ADD MONTHS

MI DateAdd

DATEADD

Last day of the month LAST DAY  
Difference between dates MONTHS BETWEEN DATEDIFF
Time zone conversion NEW TIME  
Displays the first specified weekday after a stored date NEXT DAY  
Substitute a value if it is NULL NVL ISNULL
Date round ROUND  
Re-formats date values TO DATE  
Truncates numeric values TRUNC  
Returns part of a date as a character or numeric value   DATENAME
Returns part of a date as a numeric value   DATEPART
Returns part of a date as a numeric value MI DatePart MI DatePart
Displays the current date or a date that is earlier or later than the current date NOW NOW

Copyright © 1993-2016 Meridium, Inc. All rights reserved.