Solved

Change date format in filemaker pro

Posted on 2010-08-25
6
774 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Filemaker Pro 13 Adv - Label printing 17 362
Help with getting the most recent date in FileMaker Pro 9 10 81
hidden filemaker data 1 250
IFrame in MVC 2 56
Problem: You have a hosted FileMaker database and users are tired of having to use Open Remote or Open Recent to access the database. They say, "can't you just give us something to double-click on rather than have to go through those dialogs?" An…
Having just upgraded from Filemaker 11 to Filemaker 12 over the weekend, we thought we would add some tips for others making the same move.  In general, our installation went without incident. Please note that this is not a replacement for Chapter 5…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

739 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