Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is Date String A Valid Date?
Message
From
06/07/2001 00:32:07
 
 
To
04/07/2001 19:16:38
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00526801
Message ID:
00527315
Views:
28
>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, even though Jill gave you a command that works, you could just check your constant for being empty:

? EMPTY({^2001/06/31})
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform