cancel
Showing results for 
Search instead for 
Did you mean: 

Converting String to Date Fields when String is Non-Date

former_member668841
Discoverer
0 Kudos

I'm new to Crystal Reports 2013 and have taken a Level I course. 

Trying to convert a String Field to a Date Field in a Formula and the String Field returns "False" when applying the IsDate Formula.

The Sring Field is in the form of "YYYYMMDD".  Any help is greatly appreciated.

Accepted Solutions (1)

Accepted Solutions (1)

DellSC
Active Contributor
0 Kudos

Try this:

if IsNumeric({string field}) then

Date(ToNumber(left({string field}, 4)), ToNumber(mid({string field}, 5, 2)), ToNumber(right({string field}, 2)))

-Dell

former_member668841
Discoverer
0 Kudos

That did it.  Thank you!

Answers (0)