AnsweredAssumed Answered

Script Help - Invalid Date Entry

Question asked by BrandonTerrell on Sep 7, 2012
Latest reply on Sep 7, 2012 by BrandonTerrell

Title

Script Help - Invalid Date Entry

Post

I have a solution with roughly 10,000 contact records that includes a Birthdate field. About 3000 of these actually have data in them that was imported from an outside source file in the format DD-Mon-YYYY, which Filemaker is not able to interpret as a valid date usable in calculations it would seem.  I also have some records with a date that was manually entered in Filemaker in a proper format, so some are fine.  I am trying to write a script that can go through each record and, if it has a date entered, determine first if it is in the invalid format or not and if so take the data and re-enter it in the field in the format MM/DD/YYYY that Filemaker is capable of working with.  I feel like this should be possible with the functions available, but I cannot myself figure out the proper steps to take to make a script capable of doing this, especially considering the month is in abbreviated text format, some days are single digit and some are double, and that sometimes the year is listed helpfully as YYYY but sometimes only as YY (meaning any YY entry of 12 or less would be in 2000 and any year over 12 would be in 1900).  If anyone more function-savvy than me is capable of coming up with something that would work, or if there is in fact an easier way to do this I am not aware of, I would greatly appreciate it.  Thanks!

Outcomes