Sybase Adaptive Server Anywhere Reference page 344

Table of Contents

Advertisement

Alphabetical list of functions
Parameters
Examples
Standards and
compatibility
DATEADD function [Date and time]
Function
Syntax
Parameters
Examples
Standards and
compatibility
DATEDIFF function [Date and time]
Function
Syntax
Parameters
326
expression
The value to be converted to date format. The expression is
usually a string.
The following statement returns the value 1999-01-02 as a date.
SELECT DATE( '1999-01-02 21:20:53' )
Vendor extension.
SQL/92
Not supported by Adaptive Server Enterprise.
Sybase
Returns the date produced by adding a number of the date parts to a date.
DATEADD ( date-part , numeric-expression , date-expression )
date-part
The date-part to be added to the date..
$
For a complete listing of allowed date-parts, see "Date parts" on
page 306.
numeric-expression
The numeric_expression can be any numeric type; the value is truncated to
an integer.
date-expression
The date to be modified.
The following statement returns the value:
SELECT dateadd( month, 102, '1987/05/02' )
SQL/92
Vendor extension.
Compatible with Adaptive Server Enterprise.
Sybase
Returns the interval between two dates.
DATEDIFF ( date-part , date-expression1 , date-expression2 )
date-part
Specifies the date-part in which the interval is to be measured.
$
For a complete listing of allowed date-parts, see "Date parts" on
page 306.
The number of date-parts to be added to the date.
1995-11-02 00:00:00.000
.

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents