Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.databases.filemaker > #2149
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news2.arglkargh.de!news.mixmin.net!aioe.org!.POSTED!not-for-mail |
|---|---|
| From | Helpful Harry <HelpfulHarry@BusyWorking.com> |
| Newsgroups | comp.databases.filemaker |
| Subject | Re: Validating an Input Date |
| Date | Sun, 12 Apr 2015 13:54:40 +1200 |
| Organization | Aioe.org NNTP Server |
| Lines | 47 |
| Message-ID | <120420151354408141%HelpfulHarry@BusyWorking.com> (permalink) |
| References | <1m2p1sc.onwnbc6d6k1iN%csampson@inetworld.net> <mgbrk3$24s$3@news.motzarella.org> <1m2q64x.1udi6ww1arr87qN%csampson@inetworld.net> |
| NNTP-Posting-Host | mOqy4cP0XXECXLaJAGPqUg.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:2149 |
Show key headers only | View raw
In article <1m2q64x.1udi6ww1arr87qN%csampson@inetworld.net>, Charles H.
Sampson <csampson@inetworld.net> wrote:
> Howard Schlossberg <howard@nospam.fmprosolutions.com> wrote:
> > On 4/11/2015 3:12 AM, Charles H. Sampson wrote:
> > >
> > > Is there any way in FMP (not advanced) to validate that a text string
> > > contains a correct date? Such things as only digits and slashes and
> > > values that are correct for month, day, and year?
> >
> > How about:
> > isValid( getAsDate( textEntered ) )
> >
> > Or really, you don't need the isvalid() function. Since converting an
> > invalid value to a date results in "?", you could just test for:
> > getAsDate( textEntered ) <> "?"
>
> Thanks, Howard. I forgot about IsValid lurking there among the logical
> functions. This is at least a gross check of the user input, allowing me
> to tell him that there's something wrong with his input.
>
> If I want a more specific error indication, such as invalid month number
> or month/day mismatch, is it still up to me?
Yep. IsValid will only check if the date (or whatever) is valid, but
doesn't tell you why data is not valid.
If you want a more user-friendly error message, then you will have to
make your own check calculation. You could use IsValid to first check
for a problem, then only go on to the rest if there is an error.
Checking why the date is not valid could be a bit of a problem. You
would have to check that:
- check there are only valid date characters, including if
you want to allow textual month names (e.g. "15 Jan 1996")
- the month is between 1 and 12 (which is easy, unless you want
to take into account both mm/dd and dd/mm date entry)
- the day is between 1 and 31, AND within the month's boundary,
including Leap Days for February (which is more difficult)
- possibly check the year is valid - whether that's because
you want to insist on a four digit year or within a set
period (e.g. 2000 onwards)
Helpful Harry :o)
Back to comp.databases.filemaker | Previous | Next — Previous in thread | Find similar | Unroll thread
Validating an Input Date csampson@inetworld.net (Charles H. Sampson) - 2015-04-11 03:12 -0700
Re: Validating an Input Date clkaufmann@gmx.ch (Christoph Kaufmann) - 2015-04-11 13:51 +0200
Re: Validating an Input Date csampson@inetworld.net (Charles H. Sampson) - 2015-04-11 17:43 -0700
Re: Validating an Input Date Helpful Harry <HelpfulHarry@BusyWorking.com> - 2015-04-12 13:41 +1200
Re: Validating an Input Date clkaufmann@gmx.ch (Christoph Kaufmann) - 2015-04-12 07:24 +0200
Re: Validating an Input Date Howard Schlossberg <howard@nospam.fmprosolutions.com> - 2015-04-11 12:12 -0700
Re: Validating an Input Date csampson@inetworld.net (Charles H. Sampson) - 2015-04-11 17:43 -0700
Re: Validating an Input Date Helpful Harry <HelpfulHarry@BusyWorking.com> - 2015-04-12 13:54 +1200
csiph-web