Solved

Change date format in filemaker pro

Posted on 2010-08-25
6
770 Views
Last Modified: 2012-05-10
I need to make a script that turns the following date format    2010-08-20    to      8/20/2010
0
Comment
Question by:techpr0
  • 3
  • 3
6 Comments
 
LVL 12

Accepted Solution

by:
North2Alaska earned 500 total points
ID: 33523149
I'm assuming that the date formatted as 2010-08-20 is a string and not a date.  But that you want to convert it to a date.

I would do something like the below.  Then stored as a date you can format it any way you want.
// where str is "2010-08-02" and that 08 is the month
Date ( Middle ( str; 6; 2 ) ; Middle ( str; 9; 2 )  ; Middle ( str; 1; 4) )

Open in new window

0
 

Author Comment

by:techpr0
ID: 33523252
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?
0
 
LVL 12

Expert Comment

by:North2Alaska
ID: 33523579
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.
0
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 

Author Comment

by:techpr0
ID: 33523721
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))
0
 
LVL 12

Expert Comment

by:North2Alaska
ID: 33523951
You could use the "Replace Field Contents" script step or simply loop through the current found set.
0
 

Author Comment

by:techpr0
ID: 33524048
Worked. Thanks.
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Pop up windows can be a useful feature of any Filemaker database.  Though best used sparingly, they can be employed in a multitude of different ways, for example;  as a splash screen at login, during scripted processes to control user input, as pick…
Conversion Steps for merging and consolidating separate Filemaker files The following is a step-by-step guide for the process of consolidating two or more FileMaker files (version 7 and later) into a single file with multiple tables. Sometimes th…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question