Print Page | Close Window

Contract Date

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22869
Printed Date: 03 May 2024 at 11:02pm


Topic: Contract Date
Posted By: Dejaneira
Subject: Contract Date
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



Replies:
Posted By: kevlray
Date 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

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




Print Page | Close Window