Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to store the field in table as time format ?
Message
 
À
28/05/1999 02:48:59
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00223822
Message ID:
00223825
Vues:
21
>I have 4 variables that is each represent :
>hour,minute,second,AM/PM.
>can i trim this 4 value to convert to time format and store into table ?
>After that i want to retrive it and do a compare to the system time.
>eg. if ntimeformtable > time()
>but another problem is the time() will be in 24 hours format and the time retrive form table will be 12 hour which have AM/PM. How to compare it ?
>help!!
>thanks
>
>regard,
>chang

You could convert your time to seconds: hour*3600, minute*60, +seconds. Use an IIF for the hours to add 12*3600 if PM. Then compare to SECONDS() instead of TIME(). This will also save space as you only need 5 digits for the field.
Nigel B Coates
NBC Software Services
Dublin, Ireland.
eMail: Nigel.Coates@NBCSoftware.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform