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

Differing Date formats

Featured Replies

  • Newbies

Hi,

This is probably a simple one!

I have 2 databases each with a field 'dateastext'. One is a global, and one isn't, but they are both Text format fields.

In my script, I:

Set Field[file1::dateastext;GetAsText ( Get ( CurrentDate ))]

which in one file returns:

3/3/04

and in the other returns:

3/03/04

and as a result I cannot link the two files on the date field for a portal lookup!

Do you clever chaps (and chappesses) know and way to standardise the return...

TIA,

Bob

Have you tried just using Get(CurrentDate)? 7 is smart about converting it naturally.

  • Author
  • Newbies

Yes, just tried and it didnt work... Is there any locale (regional settings)information that can be modified in the actual database file itself?

This is so frustrating!

Thanks again,

Bob

I'm not certain what would cause this, but you could always use

Right( "0" & Month(Get(CurrentDate)); 2 ) & Right( "0" & Day(Get(CurrentDate)); 2 ) & Year(Get(CurrentDate))

as your calculation.

You could also try cloning the files, to make sure they inherit the system's format. And/or in File Options.. Text, check Always use current system's settings.

But truth to be said, relying on a date to text conversion is always iffy. Why not simply use the date as date, or as a number?

Building on what Queue said, generally speaking you should make your relationships dependent on a calculation which formats consistently no matter what the system date or other input format is, such as by means of the calculation he includes.

You can still use the text date field for other things, but by picking apart and reassembling via calculation the date, you can guarantee the required consistency.

  • Author
  • Newbies

Thank you all - the

Right( "0" & Month(Get(CurrentDate)); 2 ) & Right( "0" & Day(Get(CurrentDate)); 2 ) & Year(Get(CurrentDate))

Code sorted it beautifully. I agree about the comments in using a unique number (but in my case there was a skills shortage in effecting this!)

Much happier now....

Thanks again,

Bob

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.