November 27th, 2008

CURRENT_TIMESTAMP (date and time)

Posted by admin in G. ANSI Scalar Functions

Use CURRENT_TIMESTAMP to get the current date and time from the system clock of the computer where the DBMS is running.

Example:

     SELECT CURRENT_TIMESTAMP AS 'Timestamp';

Result:

                   

> DB2, MySQL, PostgreSQL, SQL Server, and Sybase support CURRENT_TIMESTAMP.

> Access doesn’t support CURRENT_TIME. Instead it uses NOW().

> MySQL also uses NOW().

> Oracle doesn’t support CURRENT_TIME, but it does support CURRENT_TIMESTAMP and SYSDATE.

November 26th, 2008

CURRENT_TIME (today’s time)

Posted by admin in G. ANSI Scalar Functions

Use CURRENT_TIME to get the current time from the system clock of the computer where the DBMS is running.
Example:

     SELECT CURRENT_TIME AS 'Time';

Result:

                   

> DB2, MySQL, PostgreSQL, SQL Server, and Sybase support CURRENT_TIME.

> Access doesn’t support CURRENT_TIME. Instead it uses TIME().

> Oracle doesn’t support CURRENT_TIME, but it does support CURRENT_TIMESTAMP.

November 25th, 2008

CURRENT_DATE (today’s date)

Posted by admin in G. ANSI Scalar Functions

Use CURRENT_DATE to get the current date from the system clock of the computer where the DBMS is running.
Example:

     SELECT CURRENT_DATE AS 'Date';

Result:

                   

> DB2, MySQL, Oracle, PostgreSQL, SQL Server, and Sybase support CURRENT_DATE.

> Access doesn’t support CURRENT_DATE. Instead it uses DATE().

> MySQL also uses SYSDATE.

> Oracle also uses SELECT SYSDATE FROM DUAL;.

> SQL Server also uses GETDATE().

« Previous PageNext Page »