mbroad02
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
thanks
fomat field -> custum style: customise : Date Tab and change seperators
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
ASKER
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
left(x,2) +"/" + Mid (x, 2,2 )Right (x,2 )
where x is the value you are managing
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
displayField3 := DateParts[1] & '-' & DateParts[2] & '-' & Right(DateParts[3],2)
to
displayField3 := DateParts[1] & '/' & DateParts[2] & '/' & Right(DateParts[3],2)
James
ASKER
Simple and effective. thank you