Link to home
Start Free TrialLog in
Avatar of techpr0
techpr0Flag for United States of America

asked on

Change date format in filemaker pro

I need to make a script that turns the following date format    2010-08-20    to      8/20/2010
ASKER CERTIFIED SOLUTION
Avatar of North2Alaska
North2Alaska
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of techpr0

ASKER

The date formated as 2010-08-20 is a date field but shows as a ? when field not selected because of this formating.  The records are filled from an import script. I don't have access to change the data prior to going in filemaker.

All records in this field will be need to be changed to the correct formating regardless of date so how do i handle the selection of the field.

Will this solution still work based on this info?
OK, the ?? shows in the field because FM doesn't think it is a date.  So, you have a script that does the import right?  When the import is complete it should have a "Selection" (a found set) of records and you can run this piece of code on that selection.  Just set field script step to the code above, but replace "str" with the name of the field.
Avatar of techpr0

ASKER

it's formating the date correctly but only one record even though i am doing it right after the import. How do i get it to do it on all records  for the given field?

I am using the following to get the correct date as you stated.
Set Field[DateField;Date (Middle ( DateField; 6; 2)  ; Middle ( DateField; 9; 2) ; Middle ( DateField; 1; 4))
You could use the "Replace Field Contents" script step or simply loop through the current found set.
Avatar of techpr0

ASKER

Worked. Thanks.