The information in this article applies to:
SUMMARYThis article shows by example how to check the validity of a date that was entered into a character field instead of a date field.
MORE INFORMATIONThe following function (DATEEVAL) shows how an entered character date can be verified to determine if it was entered in a valid date format that could be converted to an actual date by using the CTOD() function. FUNCTION DATEEVAL PARAMETERS Datevar IF ISDIGIT(DTOC(CTOD(Datevar))) RETURN .T. ELSE RETURN .F. ENDIF This function respects the settings for SET DATE and SET CENTURY. It also assumes the default American (MM/DD/YY) format. Datevar="09/22/95" IF DATEEVAL(Datevar) WAIT WINDOW "This is a valid date!" ELSE WAIT WINDOW "This date is not in the proper format!" ENDIF Additional query words: FoxWin FoxDos 2.50 2.50a 2.50b Keywords : Version : Platform : Issue type : |
Last Reviewed: August 20, 1999 |