Date and Time

<< Click to Display Table of Contents >>

Navigation:  Data Module > Import & export > Data mappings > SQL Basics > Functions >

Date and Time

Name

Example

GETDATE

SELECT getdate()

GETUTCDATE

SELECT getutcdate()

YEAR

SELECT year(getdate()), year('7/16/2001 6:28:55 PM'), year(NULL)

MONTH

SELECT month(getdate()), month('7/16/2001 6:28:55 PM'), month(NULL)

DAY

SELECT day(getdate()), day('7/16/2001 6:28:55 PM'), day(NULL)

HOUR

SELECT hour(getdate()), hour('7/16/2001 6:28:55 PM'), hour(NULL)

MINUTE

SELECT minute(getdate()), minute('7/16/2001 6:28:55 PM'), minute(NULL)

SECOND

SELECT second(getdate()), second('7/16/2001 6:28:55 PM'), second(NULL)

MILLISECOND

SELECT millisecond('7/16/2001 6:28:55.999 PM'), millisecond(NULL)

DAYOFWEEK

SELECT dayofweek('7/16/2005 6:28:55.999 PM'), dayofweek(NULL)

DAYOFYEAR

SELECT dayofyear('7/16/2005 6:28:55.999 PM'), dayofyear(NULL)

TIMEOFDAY

SELECT TimeOfDay('7/16/2005 6:28:55.999 PM'), TimeOfDay(NULL)