Convert a date value to the year as a numeric value

     YEAR(<dDate>) --> nYear


     <dDate> is the date value to be converted.


     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.


     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.


     .  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) + " " + ;
              + "," + STR(YEAR(dDate))

 Files   Library is CLIPPER.LIB.

See Also:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.