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 7272 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

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

Posted

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

  • Newbies
Posted

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

Posted

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.

Posted

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?

Posted

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.

  • Newbies
Posted

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

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