dodsonmd Posted April 20, 2009 Posted April 20, 2009 I'm completely baffled with this time format problem. What I need is a time field, 24 hr, hhmm, in which I can enter four consecutive numbers and have the format show as HH:MM. For example, if I enter 0900, it will show as 9:00. I used a calc in FM9 that worked great, but in FM10 I get a different result. 0900 gives me 90:00? I have looked and looked for some interference with the calc and I'm stumped. The field is set to AutoEnter a calculated value, validated with a timestamp to only allow five minutes to change the input. Here is the calc: Let(tt = GetAsText(Self); Case( Length( tt ) < 5; Choose( Length( tt ); ""; Time( 0; Int( tt ); 0 ); Time( 0; Int( tt ); 0 ); Time( Int( Left( tt; 1 ) ); Int( Right( tt; 2 ) ); 0 ) Time( Int( Left( tt; 2 ) ); Int( Right( tt; 2 ) ); 0 )); Time( Int( Left( tt; 2 ) ); Int( Left( Middle( tt; 3; 2 ) & 0; 2 ) ); 0 ))) The field is 'Time' and the calc result must be 'Time". Here is the validation calc: Int(Get ( CurrentTimeStamp )-CreationStampTimeIn) ≤ 300 Calc result must be boolean. The time format dialog is set correctly, exactly as in FM9. If fact everything is just the same,but the result differs. Thanks in advance for your kind help. John
Søren Dyhr Posted April 20, 2009 Posted April 20, 2009 John read Comments reservation in the end of this post: http://fmforums.com/forum/showpost.php?post/297541/ I don't think "0700" is a valid entry into a time field. Anyway, the field has an auto-entered calculation that allows time to be entered as "6.08" and interpreted as "6:08". IIRC, it does some rounding too (it's an old file I adapted for this). If you play with it, you can adapt it to your desired format of entry. ...I'm similar surprised to learn that it might have worked at some point? Are all the people you hire ex military, or is it occuring with a certain user? The entire approach might be better served via two textfields instead? --sd
Recommended Posts
This topic is 5790 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now