VistaDB 6
VistaDB / Developer's Guide / SQL Reference / Functions / Date and Time Functions
In This Topic
    Date and Time Functions
    In This Topic
    The following are DATE and TIME functions for SQL supported by VistaDB.

    Please look at the related topics for more information about each Date and Time function.

    DATEADD - Returns a new datetime based on adding to the date passed to the function.

    DATEDIFF - Returns the number of intervals crossed between the two dates as specified by the Datepart.

    DATENAME - Returns a character string of the requested part of the date.

    DATEPART - Returns a character string of the requested part of the date.

    DAY - Returns an integer representing the DAY from a given datetime.

    GETDATE - Returns the current system date and time using the internal format for datetime values.

    GETUTCDATE - Returns the current UTC date and time (Coordinated Universal Time or Greenwich Mean Time) using the internal format for datetime values.

    MONTH - Returns an integer representing the MONTH from a given datetime.

    SYSDATETIME - Returns a datetime2(7) value that contains the date and time of the computer on which the instance of SQL Server is running.

    SYSUTCDATETIME - Returns a datetime2 value that contains the date and time of the computer on which the instance of SQL Server is running.

    SYSDATETIMEOFFSET - Returns a datetimeoffset(7) value that contains the date and time of the computer on which the instance of SQL Server is running. The time zone offset is included.

    YEAR - Returns an integer representing the YEAR from a given datetime.

    Remove TIME from a DateTime - is an interesting way to remove times from DATETIME fields if you really only want the date to be used.

    SQL Server Differences

    SQL Server will actually accept parameters out of order to many of the date and time functions when they are passed from other functions. VistaDB does not support this behavior of SQL Server.

    You also cannot pass 0 as a value for a DATETIME. .Net does not cast a 0 to the minimum date range available.

    See Also