Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Convert CurrentDate into a Date code format Post Reply Post New Topic
Author Message
Beso90
Groupie
Groupie
Avatar

Joined: 12 Jun 2014
Location: United States
Online Status: Offline
Posts: 48
Quote Beso90 Replybullet Topic: Convert CurrentDate into a Date code format
    Posted: 14 Oct 2016 at 8:40am
Hello Everyone,

One of my suppliers is requesting the date (currentDate) to be in the following format:

22A3 <-- (the actual date is January 22nd / 2003)

*22 is the day (2 digits)

*The A is a code for the month (Jan=A, Feb=B, March=C, April=D, May=E, June=F, July=G, August=H, Sept=I, Oct=J, Nov=K, Dec=L)

*The 3 is the fourth digit in the year.


What formula do I need to write to accomplish this?


Thank you and Best regards
Basel
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 14 Oct 2016 at 8:54am
here is one way

TOTEXT(TODAY,"dd")+
(if month(today)=1 then 'A' else
if month(today)=2 then 'B' else
if month(today)=1 then 'C' else
if month(today)=4 then 'D' else
if month(today)=5 then 'E' else
if month(today)=6 then 'F' else
if month(today)=7 then 'G' else
if month(today)=8 then 'H' else
if month(today)=9 then 'I' else
if month(today)=10 then 'J' else
if month(today)=11 then 'K' else
if month(today)=12 then 'L')
+ right(totext(today,"yy"),1)
IP IP Logged
Beso90
Groupie
Groupie
Avatar

Joined: 12 Jun 2014
Location: United States
Online Status: Offline
Posts: 48
Quote Beso90 Replybullet Posted: 14 Oct 2016 at 9:01am
@DBlank

Thank you so much. it worked! much appreciated!
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.