Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to insert the birth day?
Message
De
03/12/2002 01:33:34
 
 
À
03/12/2002 01:16:33
Henry Ravichander
RC Management Systems Inc.
Saskatchewan, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00728893
Message ID:
00728894
Vues:
15
This message has been marked as the solution to the initial question of the thread.
>Hi All:
>
>If I only have the Year and Month presented as the data e.g 06/82 or 6/82, how would I set a default day of 01 and then insert the new date into a field. At this point the data should appear as 06/01/1982.
>
>
i.e., mDOB = {}
>mDOB = Clinet.DOB && where the only data is 06/82 or 6/82
>mDOB = 06/01/1982 && the desired state
One way is to build a string with the unambiguous date format {^yyyy-mm-dd} and then EVALUATE() it:
* Following assumes century is 19:
* An unambiguous date will work with single-digit month and year e.g. {^1982-6-1}
DateValue = EVALUATE("{^" + "19" + RIGHT(mDOB, 2) + "-" + LEFT(mDOB, LEN(mDOB) - 3) + "-" + "1" + "}")
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform