Announcements
 Crystal Reports Forum : General Information : Announcements
Message Icon Topic: date fromat Post Reply Post New Topic
Author Message
sruthi
Newbie
Newbie


Joined: 29 Mar 2010
Online Status: Offline
Posts: 23
Quote sruthi Replybullet Topic: date fromat
    Posted: 22 Sep 2010 at 9:48pm
Hi

can any one tell how to set date format as "20th sep 2010" in CR.

Thanks
IP IP Logged
swigartd
Newbie
Newbie
Avatar

Joined: 16 Sep 2010
Location: United States
Online Status: Offline
Posts: 13
Quote swigartd Replybullet Posted: 29 Sep 2010 at 2:03am

One way to do this is to use a custom format for the date.

If you right click on your date field:
1.  Select Custom Style at the bottom of the date list
2.  Click on the Customize button.
3.  On the Custom Style input screen do the following:
     a.  Change the default order to DMY
     b.  Change the month format to "Mar"
     c.  In the Separators section change the SECOND separator to " "... you will have to type that in.  the drop down box does not have that as an option.
     d.  Put a formula in for the first separator (do this my clicking on the x-2 button.  the formula should be:
 
if Mid (ToText (day({@D}),0),2,1) in ["1"] then "st "
else
if Mid (ToText (day({@D}),0),2,1)in ["2"] then "nd "
else
"th "
 
That will give you what you want.
 
Kindest regards,
 
Dave
Aiming beyond mediocrity
IP IP Logged
aor140
Newbie
Newbie


Joined: 29 Apr 2010
Online Status: Offline
Posts: 9
Quote aor140 Replybullet Posted: 19 Oct 2010 at 10:49am
try this with the all the steps from the prevoius post except for a couple of things.
 
3c..change the SECOND separator to blank 
 
3d...use this formula for the FIRST separator by clicking the x-2 button
 
if mid(totext(day({PR_EMPLOYEE_MASTER_1_1.Employee_Date_List1}),0),1,2) in ["11","12","13"]
then "th "
else if mid(totext(day({PR_EMPLOYEE_MASTER_1_1.Employee_Date_List1}),0),1,2) in ["2","22"] then "nd "
else if mid(totext(day({PR_EMPLOYEE_MASTER_1_1.Employee_Date_List1}),0),1,2) in ["3","23"] then "rd "
else if mid(totext(day({PR_EMPLOYEE_MASTER_1_1.Employee_Date_List1}),0),1,2) in ["1","21","31"]
then "st "
else "th "
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.