Jump to content

TIME entry format


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

Recommended Posts

Greetings

I'm running FMP14 on a Mac.

I have several time fields, all of which are configured to UTC time in 24hr format and are working pretty much as expected. Several calculation fields are run off those fields.

My issue is, during data-entry, not everyone is as consistent in their notation as perhaps would be ideal... we all know how FMP loves consistency! To resolve difficulties there, and remove the need to enter ":" between HH & mm, (as in 23:45 =5 keystrokes, and a Shift-key), I'd like my dbase users to be able to enter their times as simply 2345 and have FMP manage the change in notation for the data to the necessary 23:45.

It seems back in FMP11 there used to be a LET Script step, upon which I would have (probably) been able to build a script to achieve what I desire... unfortunately, it seems LET doesn't feature in FMP14 scripting -and I aint smart enough to figure out what its alternative is now.

Any suggestions/advice gratefully received.

Regards

Link to comment
Share on other sites

LET is still there. It's a function that can be used in a calculation. It's not a script step. I haven't used v11 so don't know if it was a script step back then.

How would you break up 205 if the users intention is to type 02:05? Or 25 when they figure they can omit zeros? Is that then 25 minutes or 02:05? What if they type just 5? Is that 05:00 or 00:05?

If you want to minimize their typing, maybe use two fields for time entry: hours and minutes. And then automatically jump to the minutes field if the hour field is 2 digits. It's visually clear to the user what to enter where (assuming you label the fields accordingly). If they need to enter 02:05, they can enter 2 in the hour field, tab or enter to the minute field and enter 5 and press enter. That's four keystrokes to enter the data and exit the fields again.

Link to comment
Share on other sites

hmmmm ok, I'll go looking for it again! Thanks... likely my assumption it was a script-step that bought me undone.

205 would still enter as 02:05... the fields are all set for leading zeroes. 25? Don't know. I'll try it and see. Just 5? as I understand the data-entry rules for FMP, that would enter as 05:00. My understanding is that single-digit entries are assumed to be hours.

You might be obscuring the woods with trees there a little... my database is designed for and will be used by aviation professionals, all of whom are pretty au fait with 24hr time-entry systems. I'm merely trying to nip a potential problem in the bud whilst saving a few key-strokes, in what can at times be a fairly onerous task 😉

Many thanks for the response -I'm off back into it to have a go!

Link to comment
Share on other sites

...and it works! Now all I have to do is work it into my database without upsetting all the existing calculations!

The calculation:

Let ( t = GetAsText ( YourTable::Timefield ) ; Time ( Div ( t ; 100 ) ; Mod ( t ; 100 ) ; 0 ) )

I created a calculated field, as above, selected Calculated result as: TIME, 1 repetition, and "do not evaluate if all referenced fields are empty" selected.

Data entry takes place as 0125 in a TEXT field, and reports where I want it as 01:25. I'll need to do a little shuffling for aesthetics sake, but that's a relatively minor thing now.

I said earlier:

Quote

My understanding is that single-digit entries are assumed to be hours.

Having tested your scenarios as outlined, I find I was in error. 

205 enters as 02:05. 25 as 00:25 and 5 as 00:05.

Many thanks for the suggestion and advice!

Link to comment
Share on other sites

Pleased to be able to advise, it turns out to be easier/simpler than I thought! I have modified all my existing TIME fields to be  an Auto-entered, Calculated value, with the calculation above referencing back to the same field. So, if the field I'm working on is formatted as a Time field, and I have called it Time1, for example, my calculation is:

Let (
t = GetAsText ( time1 )
;
Time ( Div ( t ; 100 ) ; Mod ( t ; 100 ) ; 0 )
)

I have unchecked the "Do not replace existing value (if any)" box.

It's working exactly as I'd hoped, with everything working as it should.

Link to comment
Share on other sites

This topic is 2135 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.