Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to store the field in table as time format ?
Message
 
To
28/05/1999 02:48:59
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00223822
Message ID:
00223825
Views:
22
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform