September 14, 200916 yr Greets, all: Admittedly, I'm in Dense mode: I want a user to be able to enter a string of numbers for the time, e.g., 123, and have it auto-corrected in a Text field to 1:23...or 1028 would auto-correct to 10:28. Simple enough, right? But nooooooooo...no matter how much I've played with the Left, Middle, and Right commands I can't put a simple calc together to make it work since we're talking three or four digits, here. So I need your help. Now, I thought setting the Field Type to Time instead of Text, but after playing with the settings for that in the Format menu I wasn't getting anywhere. So, am I missing something with Time field type or...? Good thing I'm not a drinking man. Ciao!
September 14, 200916 yr Try: Replace ( Right ( "0000" & Self ; 4 ) ; 3 ; 0 ; ":" ) I want a user to be able to enter a string of numbers for the time, e.g., 123, and have it auto-corrected in a Text field Why in a Text field?
September 14, 200916 yr Author Thank you! That's just it: I tried the Time field type but when I entered 930 into the field, FMP changed it to 6:00 with the following settings. (See attached.) Edited September 14, 200916 yr by Guest
September 14, 200916 yr when I entered 930 into the field, FMP changed it to 6:00 Yes, because by default, when you enter an integer it is assumed to mean the number of hours. The display setting has very little to do with the data and data entry - the actual time stored in the field is 930:00:00 (you can see this if you change the display to 24 hour). 930/24 = 38.75, so what you see is 6:00 PM on day 39.
September 14, 200916 yr Author Ah! Thank you for the education! So, now you have me curious about your question of why am I using a Text field; what did you have in mind?
September 14, 200916 yr Author ...'cause *blush* I'd have to ask for another fix since, when I use your graciously-provided formula in a Time field, I get the seconds as well, so if I enter 930 it becomes 9:30:00; I still need to truncate it to 9:30.
September 14, 200916 yr Your formula works well, but I can't specify AM or PM; FileMaker's field validation jumps in when it sees a non-numeric character. Other than entering a 4-digit (24-hour) time value, is there a way to incorporate AM/PM in your formula? Many thanks--
September 15, 200916 yr is there a way to incorporate AM/PM in your formula? I don't think so. The problem here is that Filemaker's behavior is inconsistent: some formulas manage to evaluate before validation, some don't - although both return the same result. You could add a button to toggle AM/PM or - if using version 10 - forget about auto-enter and use script trigger instead.
Create an account or sign in to comment