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 None
Difference between dates MONTHS BETWEEN DATEDIFF
Time zone conversion NEW TIME None
Displays the first specified weekday after a stored date NEXT DAY None
Substitute a value if it is NULL NVL ISNULL
Date round ROUND None
Re-formats date values TO DATE None
Truncates numeric values TRUNC None
Returns part of a date as a character or numeric value None DATENAME
Returns part of a date as a numeric value None 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 © 2018 General Electric Company. All rights reserved.