Crystal Report - Chnage date field separators

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
mbroad02Asked:
Who is Participating?
 
mlmccConnect With a Mentor Commented:
Try this

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

mlmcc
0
 
LeDaoukCommented:
fomat field -> custum style: customise : Date Tab and change seperators
0
 
mbroad02Author Commented:
Sorry but that won't work as this is a TEXT field containing this date.  that's what I meant by STRING field.
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

 
LeDaoukCommented:
so make a formula and use the functions right and left to manage this issue
0
 
mbroad02Author Commented:
I need specific details and syntax how-to.  thank you
0
 
LeDaoukCommented:
create a formula:
left(x,2) +"/" + Mid (x, 2,2 )Right (x,2 )
where x is the value you are managing
0
 
James0628Commented:
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
 
mbroad02Author Commented:
Simple and effective.  thank you
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.