Parsing a date value from text field

Hi,

I have a situation where the previous developer created a form using a text field instead of a date field. The end result is that some of the data in the field contains a date along with a text description or even a date range. I’ve created a new form with a real date field. My problem is parsing the date value out of the old field and form. I was using Instr and looking for the “/” to find out if the field even contained a date value. That worked for the most part until I come across formats like: 20 July 1999 or Feb 2001 - Apr 2002. Is there an easier way to parse or do I need to just write several Instr variations to accomodate for all the variations?

Subject: Parsing a date value from text field

I don’t think there is any clever way to do this in one hit.

In situations like this I’m tempted to keep the Text field but make it CwC. Then empower the users to update their own dates! Providing them with a view of documents that need updated categorised by author!

HTH - Rufus.

Subject: RE: Parsing a date value from text field

Thanks Rufus. You just confirmed what I already thought. To make matters worse, the field is actually a rich-text field and not a text field like I originally thought. I’ll just have to parse it the way I was doing it.

Subject: Parsing a date value from text field

It looks like the previous developer used a text field because the field is intended to hold data that isn’t in date format: The month/year only entries can’t be stored as dates, so there’s no way you can convert them to dates (unless you make up an acceptable day value to add in there).