September 19, 200520 yr I'm sorry if I post in wrong forum.. My question is it's possible to enter time in field with format time without enter ":", for example if I enter 830 it will show 8:30. I need your kind suggestion... Thank you for your kind attention Thx Ben
September 19, 200520 yr Hi I assumed that the field "Time" is a text field with option of auto-enter calculation replaces existing values and calc: Case( Length ( Time ) = 0;""; Length ( Time ) ≤ 2 and GetAsNumber ( Time ) ≤ 24; Right ( "0" & Time ; 2 ) & ":00"; Length ( Time ) = 2 and GetAsNumber ( Time ) > 24 and Right ( Time ; 1 ) < 6; Right ( "0" & Left ( Time; 1 ) ; 2 ) & ":" & Right ( Time ; 1 ) & "0"; Length ( Time ) = 3; Right ( "0" & Left ( Time; 1 ) ; 2 ) & ":" & Right ( Time ; 2 ); Length ( Time ) = 4; If ( Left ( Time; 2 ) = "24"; "00:" & Right ( Time ; 2 );Right ( "0" & Left ( Time; 1 ) ; 2 ) & ":" & Right ( Time ; 2 )); "?" ) So the calc gives: for one char (eg 2) 2:00 for two char (<=24) (eg 23) 23:00 for two char (>24) (eg 83): 08:30 for tree char (eg 123): 01:23 for four char (eg 2423): 00:23 You can check if I omitted some situation !
September 19, 200520 yr For version 6, if you will be entering hours and minutes in 24-hour time, then you can use a text field for entry and stack a calculation time field, which does not allow entry, on top of it, equal to Case( not IsEmpty(textField), Time( Left( Right( "0000" & textField, 4 ), 2 ), Right( Right( "00" & textField, 2 ), 2 ), 0 ) ) You can then format the time calculation field to display as desired and reference it in place of the text field.
September 19, 200520 yr Hi Queue sure... your calc is better then mine ! (but gives some strange result if you write something like this: 2412 = 24:12 2512 = 25:12 Also, if I write 61, I think I writed 6:10 but FM gives (correctly) 1:01 (not so human)
September 19, 200520 yr That is why I stated the field can be formatted as desired. If, for example, it is formatted as hhmm with 12-hour notation, then 2412 = 12:12 AM 2512 = 1:12 AM Although, if one is entering actual 24-hour time, as opposed to elapsed time or something similar, then 2512 would be a typo.
September 19, 200520 yr Although, if one is entering actual 24-hour time, as opposed to elapsed time or something similar, then 2512 would be a typo. Yes...this I quoted. BTW I said that your calc is better ! ;-)
September 20, 200520 yr Author BTW.... I do appriciate your kind help.. What you have disscus is more than I need... Thank guy's....
Create an account or sign in to comment