0

I want to create a formula extracting dates that might be in a text field that could be formatted DDMMYY, DDMMYYYY, DD/MM/YY, DD/MM/YYYY, DD-MM-YY or DD-MM-YYYY. How is the best way to write it please? I have seen a post that searched for the"/" and moved back 2 char and then selected the next x characters but as I have 4 or 6 likely scenarios I'm not sure the best way to write it.

JRo
  • 1
  • 1
  • I would create a formula. It would first remove the slashes and hifens (use Replace function). Then, the result would fall into two different cases: 6-digit dates and 8-digits string. The remaining of the formula would use Mid function the finish the job. – heringer Jan 18 '21 at 11:57
  • Thanks so much. How would be the best way to find the string of 8 numeric characters that could be anywhere in the field please? – JRo Jan 19 '21 at 10:41
  • It depends on your data. Maybe you could split it by commas. But I must advice that it is going to a level of complexity that Crystal Reports is not intended to deal with. Crystal Reports is intendend to show data. It does small transformations. But in this case, for example, you may end up in the need of regular expressions. As far as I know, Crystal does not support regex - at least built in. – heringer Jan 19 '21 at 13:34

0 Answers0