I have a field {sortdate} that is actually a date but is formatted in the database as a string. So the text coming into Crystal (8.5)looks like "M/D/YYYY", including the slashes. The Date formula needs the string to be "YYYY,MM,DD" to work, right? The only way I can think of to convert this back to a datevalue is to use an instr formula looking for the first slash and an instrrev to look for the second slash, and then left, mid, and right formulae to identify the M, D, and Y.
numbervar pos: = instr ({sortdate}, "/")
numbervar pos2 := instrrev ({sortdate}, "/")
stringvar m := left ({sortdate},pos-1)
stringvar d := mid ({sortdate},pos+1, pos2-1)
stringvar y := right ({sortdate}, pos2+1)
datevar actualdate := (y,m,d)
There's got to be an easier way to do this. Anyone know of an easier/better/cleaner way of doing this? Thanks