Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2016 : Report Design
Message Icon Topic: Contract Date Post Reply Post New Topic
Author Message

Joined: 11 Sep 2015
Location: United States
Online Status: Offline
Posts: 11
Quote Dejaneira Replybullet Topic: Contract Date
    Posted: 13 May 2020 at 4:13am
Does anyone know a quick easy way to convert a date to 'contract date' format?

Example: 5/13/2020
Contract Format: 13th day of May, 2020
IP IP Logged
Admin Group
Admin Group

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1528
Quote kevlray Replybullet Posted: 13 May 2020 at 9:48am
Easy, that is a relative term.  You will need a formula to break up the date (month({datefield), day({datefield}), year({datefield}) ) then put it back together as a string.  The tricky part will be the day (1st, 2nd, 3rd, etc.).  With a select-case statement(could use a nested if, but this is cleaner), you will need to determine what day of the month corresponds with the suffix (not sure if that is the correct term).  So here is the start of a rough draft

+(select day({datefield}) case 1: "st" case 2 :"nd" case 3: "rd" Default: "th")+ " day of "
+ monthname(month({datefield})) +", "+totext(year({datefield}),0,"")

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.063 seconds.