Sybase Technical Library - Product Manuals Home
 inside 
[Search Forms] [Previous Section with Hits] [Next Section with Hits] [Clear Search] Expand Search

Compatibility of string functions [Table of Contents] Compatibility of data type conversion functions

Sybase SQL Anywhere User's Guide

[-] Part 4 Transact-SQL Compatibility
[-] Chapter 24: Using Transact-SQL with SQL Anywhere
[-] Using compatible functions
[-] Compatibility of date and time functions

Compatibility of date and time functions

The arguments are not listed in the date and time function tables. The Transact-SQL date and time functions are now supported as alternatives to SQL Anywhere's own functions. For full descriptions, see the SQL Server and SQL Anywhere documentation.

Date and time functions

Function Description Supported by
getdate Current system date and time both
datename Name of part of the datetime value both
datepart Value of part of the datetime value both
datediff Datetime difference both
dateadd Adds datetime parts to the date both

These date and time functions are used as follows:

SQL Anywhere date and time functions

Function Description Supported by
YEAR[S] form 1 Year of the given date SQL Anywhere
YEARS form 2 Date difference, as number of whole years SQL Anywhere
YEARS form 3 Adds dates, as number of whole years SQL Anywhere
MONTH[S] form 1 Month of the given date SQL Anywhere
MONTHS form 2 Date difference, as number of whole months SQL Anywhere
MONTHS form 3 Adds dates, as number of whole months SQL Anywhere
WEEK[S] form 1 Week of the given date SQL Anywhere
WEEKS form 2 Date difference, as number of whole weeks SQL Anywhere
WEEKS form 3 Adds dates, as number of whole weeks SQL Anywhere
DAY[S] form 1 Day of the given date SQL Anywhere
DAYS form 2 Date difference, as number of whole days SQL Anywhere
DAYS form 3 Adds dates, as number of whole days SQL Anywhere
DOW Day of the week SQL Anywhere
HOUR[S] form 1 Hour of the given date/time SQL Anywhere
HOURS form 2 Date/time difference, as number of whole hours SQL Anywhere
HOURS form 3 Adds date/times, as number of whole hours SQL Anywhere
MINUTE[S] form 1 Minute of the given date/time SQL Anywhere
MINUTES form 2 Date/time difference, as number of whole minutes SQL Anywhere
MINUTES form 3 Adds date/times, as number of whole minutes SQL Anywhere
SECOND[S] form 1 Second of the given date/time SQL Anywhere
SECONDS form 2 Date/time difference, as number of whole seconds SQL Anywhere
SECONDS form 3 Adds date/times, as number of whole seconds SQL Anywhere
NOW(*) Current date and time SQL Anywhere
TODAY(*) Today's date SQL Anywhere

Compatibility of string functions [Table of Contents] Compatibility of data type conversion functions