Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to validate dates? (month and day only)
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00457589
Message ID:
00457713
Vues:
19
Thank you all for the suggestions! Problem solved!

>>A user enters a day in a spinner. They then choose a month from a combobox. They do not enter a year. Is there an
>>easy way to tell if the month/day combination is valid?
>
>You could do:
>
>IF EMPTY(CTOD(STR(month,2)+"/"+STR(day,2)"))
>  * invalid
>ELSE
>  * valid
>ENDIF
>
>You only need the month and day to make a valid date (assumes current year).
>You may have to special checking to handle Feb. 29.
>
>Note that this is SET DATE format specific.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform