Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: string(MM/YYYY) to date Post Reply Post New Topic
Author Message
jbalbo
Senior Member
Senior Member
Avatar

Joined: 17 Feb 2011
Online Status: Offline
Posts: 219
Quote jbalbo Replybullet Topic: string(MM/YYYY) to date
     Posted: 19 Jun 2012 at 11:54am
Hi ,
 
I have data coming from sql as a string in MM/YYYY format
I need to convert to a date in the same format ?
 
 
 
Thanks
Joe
 


Edited by jbalbo - 19 Jun 2012 at 11:54am
IP IP Logged
rkrowland
Senior Member
Senior Member
Avatar

Joined: 20 Dec 2011
Location: England
Online Status: Offline
Posts: 259
Quote rkrowland Replybullet Posted: 19 Jun 2012 at 9:45pm
date(tonumber(right({table.field},4),tonumber(left({table.field},2)),01)
 
You can format the field however you like by right-clicking on it in design mode and selecting format.
 
Regards,
Ryan.
IP IP Logged
jbalbo
Senior Member
Senior Member
Avatar

Joined: 17 Feb 2011
Online Status: Offline
Posts: 219
Quote jbalbo Replybullet Posted: 20 Jun 2012 at 4:11am
Hi Ryan,
 
its sems to have an error of a missing ')' tried a few things but no luck
Cant see where its wrong??
 
IP IP Logged
rkrowland
Senior Member
Senior Member
Avatar

Joined: 20 Dec 2011
Location: England
Online Status: Offline
Posts: 259
Quote rkrowland Replybullet Posted: 20 Jun 2012 at 4:15am
That's my bad for rushing! :)
 
Try this;
 
date(tonumber(right({table.field},4)),tonumber(left({table.field},2)),01)
 
Regards,
Ryan.
IP IP Logged
jbalbo
Senior Member
Senior Member
Avatar

Joined: 17 Feb 2011
Online Status: Offline
Posts: 219
Quote jbalbo Replybullet Posted: 25 Jun 2012 at 5:56am
thx for getting back...
tried it and got string is non-numeric???
 
this is what I have in the formula
date(tonumber(right({Eliot_V_Avg_Days_Late_PN_Entry.MM/YYYY},4)),tonumber(left({Eliot_V_Avg_Days_Late_PN_Entry.MM/YYYY},2)),01)
{Eliot_V_Avg_Days_Late_PN_Entry.MM/YYYY} is a string[7]
 
thx again
 
now that I see it in writing I assume its the '/' causing it
how can I include or exclude?
 
 


Edited by jbalbo - 25 Jun 2012 at 5:57am
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