November 24, 200421 yr 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
November 24, 200421 yr 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 ) )
November 24, 200421 yr Author 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
November 24, 200421 yr 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).
Create an account or sign in to comment