Table of ContentsPreviousNext

Ispirer             Ispirer


Ispirer SQLWays Database Migration Software

GETDATE

Syntax

GETDATE()

The GETDATE function returns the current system date and time.

Example

This example selects the current system date and time.

SELECT GETDATE() 
Here is the result set: 
____________________
July 31 1977   7:00    AM 

This example creates the Employees table and uses GETDATE for a default value for the employee hire date.

CREATE TABLE Employees
(
id INT NOT NULL,
name VARCHAR(100) NOT NULL,
hire_date DATETIME DEFAULT GETDATE()
) 

Equivalents in other databases

TABLE 91. Equivalents in other databases
IBM DB2
CURRENT TIMESTAMP special register
Oracle
SYSDATE function


Table of ContentsPreviousNext
Ispirer             Ispirer
Copyright © 1999-2015 Ispirer Systems Ltd. Ispirer and SQLWays are trademarks of Ispirer Systems Ltd. All other product names may be trademarks of the respective companies. All rights reserved.