Solved

Change date format in filemaker pro

Posted on 2010-08-25
6
761 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

Author Comment

by:techpr0
Comment Utility
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
Comment Utility
You could use the "Replace Field Contents" script step or simply loop through the current found set.
0
 

Author Comment

by:techpr0
Comment Utility
Worked. Thanks.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

762 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now