Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 5607 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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!

Posted

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?

Posted (edited)

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.)

time.png

Edited by Guest
Posted

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.

Posted

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?

Posted

...'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.

Posted

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--

Posted

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.

This topic is 5607 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.