Date and time functions perform conversion, extraction, or manipulation operations on date and time data types and can return date and time information.
The date and time functions allow manipulation of time units. Most time units (such as MONTH) have four functions for time manipulation, although only two names are used (such as MONTH and MONTHS).
You should convert arguments to date functions to dates before using them. For example, this is incorrect:
days ( '1995-11-17', 2 )
This is correct:
days ( date( '1995-11-17' ), 2 )
SELECT WEEKS(‘1998/11/01’);The following statement, processed by SAP Sybase IQ, uses a different starting point for the WEEKS function and returns a different result than the statement above:
SELECT WEEKS(‘1998/11/01’) FROM iq_dummy;
SELECT MONTHS('0001/01/01');
                SELECT MONTHS('0001/01/01') FROM iq_dummy;
            SELECT DAYS('0001/01/01');
SELECT DAYS('0001/01/01') FROM iq_dummy;
The first, processed by SQL Anywhere, yields the value 307, but the second, processed by SAP Sybase IQ, yields 166.
For the most consistent results, therefore, always include the table name in the FROM clause whether you need it or not.