CMonth()

<< Click to Display Table of Contents >>

Navigation:  Available Functions >

CMonth()

Syntax

CMonth( <DateValue> )

 

Purpose

To determine the month for a given date value.

 

Parameters

<DateValue> may be the name of a date field (such as the .Donation_Date. field), but it may also be any value of date type -- such as the current date returned by the "Date()" function.

 

Returns

CMonth() returns the name of the month from a date value as a character value. The first letter is upper case and the rest of the return value is lower case.

 

Usage

CMonth() can be used to print the full spelling of the month for dates in Reports. This information may also be useful if you wish to define a selection condition based on what month of the year a donor made donations, or perhaps what month the history of a donor was last altered.

 

Example

The following examples illustrate CMonth():

 

CALL

RESULT

DATE()

09/29/2016

CMonth( DATE() )

September

CMonth( DATE() + 45 )

October

CMonth( DATE() ) + STR( DAY( DATE() ) )        

September 29

 

In defining a report, perhaps you wish the name for the month of the year each donation was made to appear next to the calendar date. To derive the name for the month of the year for each donation, you could use the following expression in the Report Writer:

 

CMonth( .Donation_Date. )