I am currently using Crystal 10 and I recieved a formula from this website that allows me to take a number field and convert it to a date field. Ex 91804 changes to 9/18/2004.
I'm having an additional problem when the years are before 2000, because the results are coming back as 9/18/2088.
This it the formula I got, but how can I fix it so that when the year is <2000, it will show as 1994.
Here is the formula.
stringvar MyDate := totext({badhdap.dadob},0,"");
if len(MyDate) = 5
then
cdate(2000+val(right(MyDate,2)), val(left(MyDate,1)),val(mid(MyDate,2,2)))
else
if len(MyDate) = 6
then
cdate(2000+val(right(MyDate,2)), val(left(MyDate,2)),val(mid(MyDate,3,2)))
I'm having an additional problem when the years are before 2000, because the results are coming back as 9/18/2088.
This it the formula I got, but how can I fix it so that when the year is <2000, it will show as 1994.
Here is the formula.
stringvar MyDate := totext({badhdap.dadob},0,"");
if len(MyDate) = 5
then
cdate(2000+val(right(MyDate,2)), val(left(MyDate,1)),val(mid(MyDate,2,2)))
else
if len(MyDate) = 6
then
cdate(2000+val(right(MyDate,2)), val(left(MyDate,2)),val(mid(MyDate,3,2)))