Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: DateFormat Post Reply Post New Topic
Author Message
dutyfree
Newbie
Newbie


Joined: 21 Jul 2008
Online Status: Offline
Posts: 24
Quote dutyfree Replybullet Topic: DateFormat
     Posted: 22 Jul 2008 at 3:58am
I have got a string value which outputs as 20080325. I need to convert this into a date format to output as 25/Mar/2008. Please assist on how i can achieve this?

I tried Totext(cdate(mid('20080325',4) + '/' + mid('20080325',5,2)+ '/'+left('20080325',7)), "dd mmm yyy") but it throws a bad syntax error.

Please help!


IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 22 Jul 2008 at 5:38am
Hi,
Create a formula
 
output
stringvar yyear;
stringvar mmonth;
stringvar dday;
yyear := '20080325'[1 to 4];
mmonth := '20080325'[5 to 6];
dday := '20080325'[7 to 9];
 
dday    & '/' & monthname(month(date(yyear & '/' & monthname(tonumber(mmonth)) & '/' & dday)),true) & '/' & yyear
 
25/Mar/2008
 
 
IP IP Logged
dutyfree
Newbie
Newbie


Joined: 21 Jul 2008
Online Status: Offline
Posts: 24
Quote dutyfree Replybullet Posted: 22 Jul 2008 at 6:01am
Hi Rahul

Thanks very much. Which books do you reckon i should read to understand this things better when creating reports in crystal reports....

Your are a star!!

Thanks again

Smile
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 22 Jul 2008 at 6:13am
Hi ,
 
I was using Brian's
 
Crystal Reports Encyclopedia Volume 1: Professional XI Reports ... you can also try answering in forums which also helps ....
 
Cheers
Rahul
IP IP Logged
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