Print Page | Close Window

String not converting to Date format DD-MMM-YYYY

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Tips and Tricks
Forum Discription: Have you learned some great tricks to share with the group? Post them here!
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=23001
Printed Date: 03 Jul 2022 at 10:46am


Topic: String not converting to Date format DD-MMM-YYYY
Posted By: DDSJ
Subject: String not converting to Date format DD-MMM-YYYY
Date Posted: 11 Apr 2022 at 7:13pm
I have a parameter of type String having text of date format dd-mm-yyyy and in formula field I am trying to change the format to dd-MMM-yyyy using formula :
ToText(cDate({Datefield}),"dd-MMM-yyyy") as I want the result in string type only.

The formula is working fine for date like "21-03-2022" which is converted to "21-Mar-2022" but date like "10-07-2022" is converted to "07-Oct-2022". The date and month is getting swapped when date is between 1-12.Dont know what goes wrong. Is there any solution to fix it ?

Thankyou



Replies:
Posted By: kevlray
Date Posted: 12 Apr 2022 at 4:23am
Sounds like a country setting. You might be better using the Day, Month, Year functions and building your own date string.



Print Page | Close Window