Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.filemaker > #2482

Re: Date Comparison Again

Path csiph.com!eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail
From Helpful Harry <HelpfulHarry@BusyWorking.com>
Newsgroups comp.databases.filemaker
Subject Re: Date Comparison Again
Date Sun, 08 Nov 2015 12:40:38 +1300
Organization Aioe.org NNTP Server
Lines 40
Message-ID <081120151240387871%HelpfulHarry@BusyWorking.com> (permalink)
References <1mdhq3t.mfhgwyznp5slN%csampson@inetworld.net> <n1lpte$sos$4@news.motzarella.org>
NNTP-Posting-Host U4um5itpdkF5Q9i2T98g9g.user.speranza.aioe.org
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding 8bit
X-Complaints-To abuse@aioe.org
User-Agent Thoth/1.8.4 (Carbon/OS X)
X-Notice Filtered by postfilter v. 0.8.2
X-Face vIZzK[X\z-._]-_:U?l@cBtwg<{a>ggn\mH}Vs>38E,#R%7h%U0'=4;1Q=erO %[T#a{YJfGvAbWmE@f_h]<rQ30+q;vqA^FUVx%\9{@r{gt${p^.L~bemFF@WY$r9fhuA F"1)$0+MgN+j8OO<SAec%$P;!M4Aj/kVitK5\xKmed-/3$2LiT1nI!-lKjt0B!qP_E{V ja+\#+[_uq8",IkoIF3M0}}qCD(&
Xref csiph.com comp.databases.filemaker:2482

Show key headers only | View raw


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


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