Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Time formatting (still can't get it to work)

Featured Replies

Hi,

I know I've previously posted a time formatting question, but for the life of me I can't get it to work the way I want to. In Access I was able to format the time so the user would time four digits (####), and the time would format ##:##. I can't get that to work in FM Pro (so far, that's been the only thing I can't get it to do vs. access).

I've tried everything, I thought it would be as simple as choosing the format (military time), and the separater ":". Right now when the user types in "1515" it will format as "1515:00". I really, really want to stay away from having to manually type in the colon as it's a annoying and time consuming keystroke (the user will most likely have to look at their keyboard if they aren't profecient typists).

I have it set to hhmm and ":" as the separator with the 24-hour clock. The example shows "23:09", but when I type in 2309 it displays 2309:00. And one other thing, I noticed if you time in "3500" it will show up as a time... I thought the computer would know there isn't a 35:00hr??

Please, can anyone help? Why isn't this as easy as MS Access?

Vandy

Make your time field auto-enter by calculation, replacce existing value.

Use this calculation

Time ( Left ( Time; 2 ) ; Right ( Time ; 2 ) ; 0 )

Format the field as you have.

I think maybe the crux of the problem is that FM considers times in a way that is not helpful for your current task. It is thinking not (necessarily) of a time of day, but a number of hours. It's true that from a time-of-day perspective, there is no 3500. However, it is possible to think of 35 hours -- as in, there are 35 hours between 1 am Sunday and noon Monday -- and that is how FM is approaching it.

As far as the entry issue you identify: It's not that this is easier in M$ Acce$$, it's just different. How can an application decide whether a user means "1515:00" or "15:15"? I suppose FMInc could make this an option on the field, but there's a whole host of things they could make options. In your case, i think your best bet may be to make the entry field a number field, and then create a calc time field that converts the text entered into time in the way you want. You could set up the entry field with validation rules, such as (entryField <= 2400) and (entryField >= 0). Then your calc time field would be something like:


Time(Hours(Int(entryField/100));Minutes(Mod(entryField;100));0)

HTH,

Jerry

Huh. Ralph got it quicker AND better.

Or:

Time ( Left ( Right ( "00" & Timefield ; 4 ) ;2) ; Right ( Timefield ; 2 ) ; 0 )

to spare the user the necessity of entering leading zeroes.

  • Author

Thanks Ralph, it works like a charm, exactly what I needed!!!

Thank you very much, it was frustrating me to no end!

Vandy

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.