Display Month Name Instead of Month Number In Crystal Report

Ashraful picture Ashraful · Feb 3, 2014 · Viewed 31.5k times · Source

How Can I display Month Name Instead of Month Number (Not Data Format Number) In Crystal Report?

Answer

Cris picture Cris · Feb 3, 2014

The MonthName function can be used to display the name of the month, when you provide a number between 1 and 12 (1 being January). It is useful for showing the month name in Group titles or labeling groups in charts.

It can be combined with the DatePart function to return the month name of a variable or calculation.

Syntax

 MonthName(month, abbr) 

    Month   A number from 1 to 12.    
    abbr    Optional.A Boolean value. If true, the month name is abbreviated. The default is false.

Examples

Example                                 Result
MonthName(5)                            “May”
MonthName(10)                           “October”
MonthName(10,True)                      “Oct”
MonthName(DatePart(“m”, CurrentDate))   “October” when the current date is 10/5/10.