Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.databases.filemaker > #2482
| From | Helpful Harry <HelpfulHarry@BusyWorking.com> |
|---|---|
| Newsgroups | comp.databases.filemaker |
| Subject | Re: Date Comparison Again |
| Date | 2015-11-08 12:40 +1300 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <081120151240387871%HelpfulHarry@BusyWorking.com> (permalink) |
| References | <1mdhq3t.mfhgwyznp5slN%csampson@inetworld.net> <n1lpte$sos$4@news.motzarella.org> |
In article <n1lpte$sos$4@news.motzarella.org>, Howard Schlossberg <howard@nospam.fmprosolutions.com> wrote: > On 11/7/2015 12:44 AM, Charles H. Sampson wrote: > > > > I start out the script with the following: > > > > Set Variable [$StartupDate; Value:Get(ScriptParameter)] > > Set Variable [$ThisDay; Value:Day ($StartupDate)] > > Set Variable [$ThisMonth; Value:Month ($StartupDate)] > > Set Variable [$ThisYear; Value:Year ($StartupDate)] > > > > Subsequent custom dialogs indicate that these four values are what I > > expect. Comparisons of this date to other dates don't work. (I'll supply > > more detail if needed.) > > > > Here's the new piece of information. If I follow the first Set Variable > > above (Get(ScriptParameter)) with > > > > Set Variable [$StartupDate; Value:Date (Month ($StartupDate); > > Day ($StartupDate); Year ($StartupDate))] > > > > the script now works. Probem solved? Maybe so, but I'd like to know why > > implicit type conversions appear to work sometimes and don't in others. > > My guess is that the day, month and year functions tell FileMaker that > the input is to be treated as a date, so that any text input (which is > ALL a script parameter is) is first converted to a date automatically so > that FM can get the day, month or year. > > To fix your problem, just change the first step to: > > Set Variable [ $StartupDate; Value: GetAsDate( get(scriptParameter) ) ] Unlike many programming languages, FileMaker is pretty forgiving about mixing data types ... *BUT* dates and times do seem to be more picky than numbers and text. Possibly that's at least partly due to the various different formatting dates can have (i.e. DD/MM/YY or MM/DD/YYYY or DD MMMMM, YYYY, or DD.MM.YYYY, etc.) Helpful Harry :o)
Back to comp.databases.filemaker | Previous | Next — Previous in thread | Find similar | Unroll thread
Date Comparison Again csampson@inetworld.net (Charles H. Sampson) - 2015-11-07 00:44 -0800
Re: Date Comparison Again Martin Τrautmann <t-usenet@gmx.net> - 2015-11-07 09:14 +0000
Re: Date Comparison Again Howard Schlossberg <howard@nospam.fmprosolutions.com> - 2015-11-07 13:21 -0800
Re: Date Comparison Again Helpful Harry <HelpfulHarry@BusyWorking.com> - 2015-11-08 12:40 +1300
csiph-web