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

Recommended Posts

Posted

ok, in the database I inherited there is a field that should be a date field, but was created as a text field. We wanted to change it to only allow dates so I changed it to a date field. Now here is the problem, any record that had that field as only a 2 digit year for the years 2000 - 2004, is now reading and 1900 - 1904. Is there anyway to create and run a script to change this? I guess I would need to add 100 years to the date, but I'm not exactly sure how to go about doing that.

Any help would be much appreciated.

Thanks,

Rick confused.gif

Posted

If Year(date_field) < 1905

Set Field date_field

Let ([mo = Month(date_field);dy = Day(date_field);yr=Year(date_field)+100]; Date ( mo ; dy ; yr )

)

Posted

Well i am using FM 6.. so i don't have a LET command, but i actually came up with something on my own right before you posted.. basically i did:

SetField[DateField, TextToDate(Substitute( DateToText(DateField) , 190, 200 ))]

I haven't done it on the full database yet, but it seems to have worked on the few records i tried it on..

Thanks though,

Rick

Posted

Well, good. I'm just so used to using Let now ... (besides, I'm an old Basic programmer who used to use Let all the time).

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