Home
Crystal Reports Training
Crystal Reports XI
Crystal Reports .NET
Crystal Reports Forum
News
Tech Support
Active Topics
Memberlist
Search
Help
Register
Login
Technical Questions
Crystal Reports Forum
:
Crystal Reports 9 through 2022
:
Technical Questions
Topic: Changing string field format
Author
Message
rjjj1111
Newbie
Joined: 04 Feb 2013
Online Status: Offline
Posts: 5
Topic: Changing string field format
Posted: 05 Feb 2013 at 7:32am
I have a string field 850315
I need to change it to 03-15-85
what is the code to do this inside a formula?
IP Logged
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Posted: 05 Feb 2013 at 9:13am
try
picture(field,"xx-xx-xx")
IP Logged
rjjj1111
Newbie
Joined: 04 Feb 2013
Online Status: Offline
Posts: 5
Posted: 05 Feb 2013 at 9:36am
that result brought back 85-03-15 for string 850315
i need 03-15-85
any suggestions?
what about left right mid function on the field?
would that work? if so what is the code?
Edited by rjjj1111 - 05 Feb 2013 at 9:37am
IP Logged
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Posted: 05 Feb 2013 at 9:54am
oops sorry. I did not look close enough.
Are you trying to make this into a date?
IP Logged
rjjj1111
Newbie
Joined: 04 Feb 2013
Online Status: Offline
Posts: 5
Posted: 05 Feb 2013 at 11:01am
yes, but it is for display only. so it could stay a string
IP Logged
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Posted: 05 Feb 2013 at 11:46am
ok you can use the left mid or right
picture((right(field,4)+left(field,2)),'xx-xx-xx')
IP Logged
rjjj1111
Newbie
Joined: 04 Feb 2013
Online Status: Offline
Posts: 5
Posted: 05 Feb 2013 at 11:52am
I was trying to do something like this but i could not get the mid function working correctly? I am not sure what i was doing incorrect?
date(tonumber(mid({Command.AP1VALDATE},3,2)),tonumber(right({Command.AP1VALDATE},2)),tonumber(left({Command.AP1VALDATE},2)))
does anyone have any suggestions?
Edited by rjjj1111 - 05 Feb 2013 at 11:53am
IP Logged
rjjj1111
Newbie
Joined: 04 Feb 2013
Online Status: Offline
Posts: 5
Posted: 05 Feb 2013 at 11:58am
DBlank
sorry i missed your earlier post.
that worked perfect............thanks......!!!!!
IP Logged
Printable version
Forum Jump
-- Select Forum --
Announcements
Talk with the Author
Self-Publishing
Job Postings
New feature request
Report Design
Data Connectivity
Technical Questions
Tips and Tricks
Crystal Xcelsius
Report Design
Data Connectivity
Writing Code
Tips and Tricks
Report Design
Data Connectivity
Writing Code
Tips and Tricks
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
HOME
|
FREE EBOOK
|
PROGRAMMING GUIDE
|
PURCHASE
|
REVIEWS
|
CONTACT ME
|
FAQ
|
LINKS
|
PRIVACY
|
CLICK PLAYS
|
KONACAD
© 2004-2026 Brian Bischof. All Rights Reserved.