SAP Knowledge Base Article - Public

1701425 - How to change the date in to a text wording

Symptom

 

How to change the date in to a text wording

Environment

Crystal report 2008

Crystal report 2011

Resolution

  1. Create a sample report which will have any date field
  2. Write the following formula and place it in the report

WhileReadingRecords;
NumberVar DayIn := Day (date field);
"This "
& Totext (DayIn , 0 )
& (if DayIn in 4 to 20 then 'th' else
if remainder (DayIn , 10) = 1 then 'st' else
if remainder (DayIn , 10) = 2 then 'nd' else
if remainder (DayIn , 10) = 3 then 'rd' else 'th')
& " day of "
& Totext (date field , "MMMM, yyyy")

For example, if the date is 22/03/2002 then it will display "This 22nd day of March, 2002"

Keywords

converting date to text words, date to text words in crystal, date to words in CR 2008, date to words in CR 2011 , KBA , BI-RA-CR-DSL , Crystal Reports on C++ Data Semantic Layer (ClassicUniverse) , How To

Product

Crystal Reports 2008 V1 ; SAP Crystal Reports 2011