Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is Date String A Valid Date?
Message
De
05/07/2001 02:09:16
 
 
À
04/07/2001 19:28:37
Jill Derickson
Software Specialties
Saipan, CNMI
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00526801
Message ID:
00526835
Vues:
21
Jill:

What a Gal ! Exactly the type of solution I was looking for. I knew there must be one, I just couldn't see it. Thank you so much !

>Gary,
>
>Try:
>EMPTY( CTOD(YourCharacterDateString) )
>
>if EMPTY is .T. it's an illegal date string
>
>
>>Hello All!
>>
>>Is there any way to test whether a date constant/string is a valid date ?
>>
>>For example, if a constant is assembled as follows :-
>>
>>{^2001/06/31}
>>
>>Clearly, this is an invalid date as there are only 30 days in June. To test whether a date string is valid, I could set up an error handler and subject this date string/constant to a date calculation. If it fails, then it is trapped and I have an invalid date.
>>
>>However, is there a way to do this without an error handler, just using this value in some form of expression that returns True/False or a DateValue/EmptyDateValue or similar ?
>>
>>Any tips much appreciated.
-=Gary
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform