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:
00019765
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?)
>

TIME() does this (but the seconds settings I've tried don't seem to work on 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).
>
I attempted this with numeric, but it didn't work out too well, the data entry was awkward. I'll give the char idea a try...I don't realy care about the date, as you note below I can always deal with that, it's just the HH:MM input that I really need. The one problem with the IAC is that also time has total H/M restrictions too, like 12 and 60. I guess I can check these too with VAL()...

>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.
>
Yes, that sounds good. I thought this project was going to be pretty easy. Famous last words...Thanks for the input.
The Anonymous Bureaucrat,
and frankly, quite content not to be
a member of either major US political party.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform