EQL provides four constant keywords to obtain current date and time values. Values are obtained at an arbitrary point during query evaluation.
GMT time and date are independent of any daylight savings rules, while System time and date are subject to daylight savings rules.
Keyword | Description |
---|---|
CURRENT_TIMESTAMP | Obtains current date and time in GMT. |
SYSTIMESTAMP | Obtains current date and time in server time zone. |
CURRENT_DATE | Obtains current date in GMT. |
SYSDATE | Obtains system date in server time zone. |
The following example retrieves the average duration of service:
RETURN Example AS SELECT AVG(CURRENT_DATE - DimEmployee_HireDate) AS DurationOfService GROUP