Tips and Tricks
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Tips and Tricks
Message Icon Topic: String not converting to Date format DD-MMM-YYYY Post Reply Post New Topic
Author Message
DDSJ
Newbie
Newbie


Joined: 18 Aug 2021
Online Status: Offline
Posts: 12
Quote DDSJ Replybullet Topic: String not converting to Date format DD-MMM-YYYY
    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
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet 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.
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.