Re: Date object into FMP field
Re: Date object into FMP field
- Subject: Re: Date object into FMP field
- From: Andrew Oliver <email@hidden>
- Date: Thu, 11 Mar 2004 12:03:49 -0800
On 3/11/04 11:25 AM, "Gary (Lists)" <email@hidden> wrote:
>
Andy O. gave you some stuff that is _way_ too complicated. Just get the
>
Day, Month, Year from your AS date, make it text, plop that into the FM date
>
field.
...
>
He takes the whole AS date blob, makes that a string, with all
>
the "Wednesday" and time stuff, then uses FM instead of AS to break it
>
down.]
Actually, no, Gary.
What I said to do (and what I did in my case) was use AppleScript to build a
string containing the elements I wanted in the form "3 11 2004" which I put
into a Filemaker Text field.
A calculation field in the same database parses out the three 'words' of
that string and populates a Filemaker Date. AppleScript does the bulk of
this work.
I took this approach since I could not find a simple, portable (read:
international date format-aware) manner to put an AppleScript 'date' object
into a Filemaker 'date' field.
If you want the code I'm sure I can find it somewhere.
Andrew
:)
>
Simon Forster wrote [3/11/04 6:26 AM]:
>
>
> I'm working on a project where I have an AppleScript date object which
>
> I want to write to a FileMaker Pro date field.
>
>
FM won't handle the date object, as you found. You need to get just the
>
actual _day date_ values (meaning, ditch the time stuff).
>
>
You have to coerce the date to text, get the portion you want (using any of
>
several AS methods to get out the date string stuff).
>
>
FM date formatted fields still get text entered. They become 'dates' for FM
>
purposes, based on the field formatting options and your local time/date
>
settings.
>
>
> Just trying to set the
>
> field to the date object fails. I can get the date as a string in the
>
> dd/mm/yyyy format that my (UK) version of FileMaker will accept.
>
> However, as soon as someone in the US uses this script, it'll fail (or
>
> give unexpected results).
>
>
>
> So, what's the preferred way of getting a date into a FileMaker Pro
>
> date field?
>
>
Andy O. gave you some stuff that is _way_ too complicated. Just get the
>
Day, Month, Year from your AS date, make it text, plop that into the FM date
>
field.
>
>
You don't need any calculation fields or LeftWords() and all this. [But, of
>
course, that doesn't make Andy's method wrong...it's just the reverse of my
>
suggestion. He takes the whole AS date blob, makes that a string, with all
>
the "Wednesday" and time stuff, then uses FM instead of AS to break it
>
down.]
>
>
Either way. I think doing the work in AS is much faster, and you don't need
>
extra fields in your FM file.
>
--
>
Gary
>
_______________________________________________
>
applescript-users mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/applescript-users
>
Do not post admin requests to the list. They will be ignored.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.