Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
Solved

# Crystal Report - Chnage date field separators

Posted on 2011-03-16
Medium Priority
727 Views
Hopefully this is an easy question.  I have a string field which contains a date field.  The date is formatted as MM-DD-YY and I wish to change that to MM/DD/YY.  How can I do this?
thanks
0
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points

LVL 4

Expert Comment

ID: 35149016
fomat field -> custum style: customise : Date Tab and change seperators
0

Author Comment

ID: 35149128
Sorry but that won't work as this is a TEXT field containing this date.  that's what I meant by STRING field.
0

LVL 4

Expert Comment

ID: 35149218
so make a formula and use the functions right and left to manage this issue
0

Author Comment

ID: 35149232
I need specific details and syntax how-to.  thank you
0

LVL 4

Expert Comment

ID: 35149268
create a formula:
left(x,2) +"/" + Mid (x, 2,2 )Right (x,2 )
where x is the value you are managing
0

LVL 101

Accepted Solution

mlmcc earned 2000 total points
ID: 35149655
Try this

Replace({DateFieldString},'-','/')

mlmcc
0

LVL 35

Expert Comment

ID: 35154742
If this is related to your previous question about pulling the dates out of a string and reformatting them (and assuming that you don't need the dates in both MM/DD/YY _and_ MM-DD-YY format), then you could just replace the "-"s in your formula with "/"s.  For example, change

displayField3 := DateParts[1] & '-' & DateParts[2] & '-' & Right(DateParts[3],2)
to
displayField3 := DateParts[1] & '/' & DateParts[2] & '/' & Right(DateParts[3],2)

James
0

Author Closing Comment

ID: 35215226
Simple and effective.  thank you
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirementsâ€¦
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 biâ€¦
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/weâ€¦
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signalâ€¦
###### Suggested Courses
Course of the Month10 days, 14 hours left to enroll