[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 YEAR()
 Convert a date value to the year as a numeric value
------------------------------------------------------------------------------
 Syntax

     YEAR(<dDate>) --> nYear

 Arguments

     <dDate> is the date value to be converted.

 Returns

     YEAR() returns the year of the specified date value including the
     century digits as a four-digit numeric value.  The value returned is not
     affected by the current DATE or CENTURY format.  Specifying a null date
     (CTOD("")) returns zero.

 Description

     YEAR() is a date conversion function that converts a date value to a
     numeric year value.  Use it in calculations for things like periodic
     reports or for formatting date displays.

     YEAR() is a member of a group of functions that return components of a
     date value as numeric values.  The group includes DAY() and MONTH()
     which return the day and month values as numeric values.

 Examples

     .  These examples illustrate YEAR() using the system date:

        ? DATE()                    // Result: 09/20/90
        ? YEAR(DATE())              // Result: 1990
        ? YEAR(DATE()) + 11         // Result: 2001

     .  This example creates a user-defined function using YEAR() to
        format a date value in the following form: month day, year.

        ? Mdy(DATE())               // Result: September 20, 1990

        FUNCTION Mdy( dDate )
           RETURN CMONTH(dDate) + " " + ;
                 LTRIM(STR(DAY(dDate)));
              + "," + STR(YEAR(dDate))

 Files   Library is CLIPPER.LIB.


This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson