>Is there any way to test if a string will evaluate to a valid date without parsing the string? I tried something like TYPE(CTOD(lcMyString)) and other variations on this theme but nothing seems to work. The empty string (" / / ") must be accepted as a valid date also.
>
>I can't find anything that will work though it seems that there should be some way to get VFP to tell you if a string will be a valid date, but I can't find anything.
>
>I tried the following but it does not work:
> lcString = "abc"
> ldTest = CTOD(lcString)
>because VFP returns {//} which is not acceptable, since the input may be an empty date, but input of an empty date is acceptable so there would be no way to distinguish between input of a valid empty date or an invalid date.
>
>Thanks.
Would this do?
empty(chrtran(m.lcDate,"/","")) or !empty(ctod(m.lcDate))
Cetin