Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
HH:MM Date in Textbox
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00019749
Message ID:
00019761
Views:
43
>Actually, I'm not quite sure what I'm doing :~) I'm doing a timesheet app where the user must enter HH:MM in several places each day, the field should be blank until data is entered, then in HH:MM format. This is fixed in the design.
>
>I've explored using date, numeric and char fields, but nothing has worked the way I'd like so far...I like the datetime because it has a builtin check against bad values...but I'm open to any ideas, especially if anyone else has done something like this already..

I never needed datetime, so I never really "investigated" this type. I am very surprised how bad it's implemented. There is no FoxPro function to extract time from a datetime. (Or I didn't find it?)

In your case, I would use 2 fields. One for date, one for time. For time field: a char field with a special class: InputMask: 99:99. You can use InteractiveChange to test each key pressed (because it's fired for each key).

You can also have a hidden field of type datetime where you can keep the date and time in a standard format (this way you don't depend on SET DATE, SET SECONDS, a.m./p.m., etc). Replace this field each time by program, it's not a user entered field. It can be very good for indexes, even if it means a redundancy in your database.

Vlad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform