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.

problems: date formatting and auto-entry of dates

Featured Replies

I have been using a FM6 DB as a lab notebook for the past 3 years. I recently upgraded to FM7 and migrated my old files over to FM7. My layout has a date field that is set to auto-enter the current date upon creation of a new record. When I created the FM6 DB, I had my Control Panel:International:Date settings set to DD.MM.YYYY and the field format was set to be the same, but now I have both these settings set to standard US usage. So now in FM, I have the date field set to be formatted MM/DD/YYYY and I have the Use System Formats checked. My problem is that when FM7 does the auto-entry, it enters the date as DD.MM.YYYY and causes a validation error in that field (I see a '?' in the field). If I then manually change the date to MM/DD/YYYY, FM7 accepts it. This behavior occurs whether or not I have the Use System Formats checked. However, the date shows up DD/MM/YYYY if I uncheck Use System Formats (it toggles between DD/MM/YYYY and MM/DD/YYYY when I check and uncheck it, but never shows up using a period as the separator). How do I make FM7 enter the date in the field in the correct format? I have read in the help that some of the formatting settings from when the file was created are somehow embedded in the file. . .how can I strip them out or make my files 'relearn' their formatting and international settings?

When there's a question mark, that means the field is not big enough smile.gif Just increase the field's width a little, and you will see full-formatted date.

  • Author

thanks for the quick response, H.P. but, i have tried that and it doesn't help.

Um, if you cannot find a solution to that problem and all else failed, try to work around with this:

Instead of auto-enter with date, make it auto-enter with calculation and put in this: = get(todaydate).

If it still doensn't auto-format or still displays the question mark, try to put this in the calculation: = month(get(todaydate)) & "/" & day(get(todaydate)) & "/" & year(get(todaydate))

It's a rather stupid work around but it works I think. I bet someone else might have a better solution.

  • Author

does get(todaydate) work with FM7? I thought I saw that this function is no longer implemented in FM7.

That function doesn't exist in any version. Get( CurrentDate ) is what you want. It's equivalent to Status( CurrentDate ) in previous versions. 'Today' is the function that's no longer available.

Ooopse... I didn't rem. the exact name for that function. Sorry Isen smile.gif

  • Author

thanks for the help and workarounds. but, is there a way to "reset" the international settings of my datbase? i am referring to the fact that i read in the help that FM DBs retain the international formatting settings from when they were created. can i make my DBs to have US formatting?

  • Author

i tried using

Date=Month(Get(CurrentDate)) & "/" & Day(Get(CurrentDate)) & "/" & Year(Get(CurrentDate))

this resulted in an empty field.

Did you try this: file -> file option -> text -> data entry -> use system settings?

For the caculation above to work, put only this in the caculated value:

Month(Get(CurrentDate)) & "/" & Day(Get(CurrentDate)) & "/" & Year(Get(CurrentDate))

Also, if you use this approach, please set the field type to text.

  • Author

yes, i have the "always use system settings" box checked.

i have my records sorted by date (the date that is in the problematic field). if i set the field type to text, will my sorting still work correctly?

Have you tried making a clone of your file with the options set for US dates? The clone should have the correct format.

  • Author

oh, i forgot. . .i only had

Month(Get(CurrentDate)) & "/" & Day(Get(CurrentDate)) & "/" & Year(Get(CurrentDate))

in the calculated value field as you suggested. smile.gif

  • Author

doesn't a clone of a file have the formatting but not the data? i'd like to keep my data. . .

or should i clone the file and then import the data from the old db into the new cloned db?

  • Author

saving a copy of the file and then tyring to work with the copy doesn't solve the problem (dates are still auto-entered as dd.mm.yyyy)

It has to be a clone not a copy. After the clone is made, you will have to import the data from the oridginal file.

  • Author

well, that's sort of a pain, but it worked. thanks for all the help.

seems to me there should be an easier way. . .

cheers,

tom

You only have to do it once. It is certainly less painful than most of the other suggestions.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.