Link to home
Start Free TrialLog in
Avatar of mbroad02
mbroad02Flag for United States of America

asked on

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
Avatar of LeDaouk
LeDaouk
Flag of Lebanon image

fomat field -> custum style: customise : Date Tab and change seperators
Avatar of mbroad02

ASKER

Sorry but that won't work as this is a TEXT field containing this date.  that's what I meant by STRING field.
so make a formula and use the functions right and left to manage this issue
I need specific details and syntax how-to.  thank you
create a formula:
left(x,2) +"/" + Mid (x, 2,2 )Right (x,2 )
where x is the value you are managing
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of James0628
James0628

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
Simple and effective.  thank you