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


Groups > comp.databases.filemaker > #2802 > unrolled thread

Finding in a Script Using Dates with Wildcards

Started bycsampson@inetworld.net (Charles H. Sampson)
First post2017-04-04 20:51 -0700
Last post2017-04-10 19:40 -0700
Articles 9 — 5 participants

Back to article view | Back to comp.databases.filemaker


Contents

  Finding in a Script Using Dates with Wildcards csampson@inetworld.net (Charles H. Sampson) - 2017-04-04 20:51 -0700
    Re: Finding in a Script Using Dates with Wildcards Martin Τrautmann <t-usenet@gmx.net> - 2017-04-05 04:59 +0000
      Re: Finding in a Script Using Dates with Wildcards Helpful Harry <HelpfulHarry@BusyWorking.com> - 2017-04-05 18:51 +1200
    Re: Finding in a Script Using Dates with Wildcards Howard Schlossberg <howard@nospam.fmprosolutions.com> - 2017-04-05 11:08 -0700
    Re: Finding in a Script Using Dates with Wildcards csampson@inetworld.net (Charles H. Sampson) - 2017-04-10 13:57 -0700
      Re: Finding in a Script Using Dates with Wildcards ursus <ursus.kirk@gmail.com> - 2017-04-10 23:41 +0200
      Re: Finding in a Script Using Dates with Wildcards Howard Schlossberg <howard@nospam.fmprosolutions.com> - 2017-04-10 14:58 -0700
        Re: Finding in a Script Using Dates with Wildcards Helpful Harry <HelpfulHarry@BusyWorking.com> - 2017-04-11 13:51 +1200
          Re: Finding in a Script Using Dates with Wildcards Howard Schlossberg <howard@nospam.fmprosolutions.com> - 2017-04-10 19:40 -0700

#2802 — Finding in a Script Using Dates with Wildcards

Fromcsampson@inetworld.net (Charles H. Sampson)
Date2017-04-04 20:51 -0700
SubjectFinding in a Script Using Dates with Wildcards
Message-ID<1n3z5a7.12we6wpxhv9ghN%csampson@inetworld.net>
How do you execute a find in a script using a date such as 3/*/2017?
Whenever I try it, I get a message that "3/*/2017" is not a date.

As usual, I'm still using FileMaker Pro 8.0v3 on a G5 running 10.5.8.

Thanks in advance.

Charlie
-- 
Nobody in this country got rich on his own.  You built a factory--good.
But you moved your goods on roads we all paid for.  You hired workers we
all paid to educate. So keep a big hunk of the money from your factory.
But take a hunk and pay it forward.  Elizabeth Warren (paraphrased)

[toc] | [next] | [standalone]


#2804

FromMartin Τrautmann <t-usenet@gmx.net>
Date2017-04-05 04:59 +0000
Message-ID<slrnoe8uct.3kh.t-usenet@ID-685.user.individual.de>
In reply to#2802
On Tue, 4 Apr 2017 20:51:03 -0700, Charles H. Sampson wrote:
> How do you execute a find in a script using a date such as 3/*/2017?
> Whenever I try it, I get a message that "3/*/2017" is not a date.
>
> As usual, I'm still using FileMaker Pro 8.0v3 on a G5 running 10.5.8.

Try 3/1/2017..3/31/2017
Martin

[toc] | [prev] | [next] | [standalone]


#2807

FromHelpful Harry <HelpfulHarry@BusyWorking.com>
Date2017-04-05 18:51 +1200
Message-ID<050420171851499161%HelpfulHarry@BusyWorking.com>
In reply to#2804
In article <slrnoe8uct.3kh.t-usenet@ID-685.user.individual.de>, Martin
‘§rautmann <t-usenet@gmx.net> wrote:
> On Tue, 4 Apr 2017 20:51:03 -0700, Charles H. Sampson wrote:
> >
> > How do you execute a find in a script using a date such as 3/*/2017?
> > Whenever I try it, I get a message that "3/*/2017" is not a date.
> >
> > As usual, I'm still using FileMaker Pro 8.0v3 on a G5 running 10.5.8.
> 
> Try 3/1/2017..3/31/2017
> Martin

That would be the best way (although I thought it was three dots
between the two dates). The Find Mode wildcards aren't really designed
for anything except text.

You could try using the function GetAsDate("3/*/2017"), but I doubt
that will work either.

Helpful Harry  :o)

[toc] | [prev] | [next] | [standalone]


#2808

FromHoward Schlossberg <howard@nospam.fmprosolutions.com>
Date2017-04-05 11:08 -0700
Message-ID<oc3bl7$5h4$1@news.motzarella.org>
In reply to#2802
On 4/4/2017 8:51 PM, Charles H. Sampson wrote:
> How do you execute a find in a script using a date such as 3/*/2017?
> Whenever I try it, I get a message that "3/*/2017" is not a date.
>
> As usual, I'm still using FileMaker Pro 8.0v3 on a G5 running 10.5.8.


"3/*/2017" should work just fine.  How are you using it in your script 
-- i.e. within the Perform Find script step, Set Field, insert 
calculated result, or...?  And are you setting it directly into one of 
those steps or are you first setting a variable and then setting the 
variable to those steps?

Howard

[toc] | [prev] | [next] | [standalone]


#2809

Fromcsampson@inetworld.net (Charles H. Sampson)
Date2017-04-10 13:57 -0700
Message-ID<1n49pv5.1m4u9y3yod6u3N%csampson@inetworld.net>
In reply to#2802
Charles H. Sampson <csampson@inetworld.net> wrote:

> How do you execute a find in a script using a date such as 3/*/2017?
> Whenever I try it, I get a message that "3/*/2017" is not a date.
> 
> As usual, I'm still using FileMaker Pro 8.0v3 on a G5 running 10.5.8.
> ,,,

I got useful advice from three of the usual suspects. Thanks to all.
However, it's clear that my question was much to imprecise. To try to
clarify, here's an example of what I've been trying:

The month that I want to use is input using a custom dialog. It's
therefore in a global field, named DISummaryMonth. I calculate the year
based on the assumption that the most recent of the specified months is
meant; this value is in $SummaryYear. The following code doesn't work:

   Go to Layout ("xyz")
   Enter Find Mode []
   Set Field [xyz::Date; Date (DISummaryMonth, "*", $SummaryYear]
   Perform Find []

The result is the error message "No records match this set of find
requests." This isn't surprising when I display xyz::Date before
performing the find; it is "?" and that's what is displayed in the Date
field of layout xyz. The value xyz::Date: [?]  has also been filled into
the specification of the Perform Find command.

I hope this is clearer, I'm willing to continue to clarify as long as
you are willing to put up with me.

Charlie
-- 
Nobody in this country got rich on his own.  You built a factory--good.
But you moved your goods on roads we all paid for.  You hired workers we
all paid to educate. So keep a big hunk of the money from your factory.
But take a hunk and pay it forward.  Elizabeth Warren (paraphrased)

[toc] | [prev] | [next] | [standalone]


#2810

Fromursus <ursus.kirk@gmail.com>
Date2017-04-10 23:41 +0200
Message-ID<ocgu19$bad$1@dont-email.me>
In reply to#2809
Op 10-4-2017 om 22:57 schreef Charles H. Sampson:
> Charles H. Sampson <csampson@inetworld.net> wrote:
>
>> How do you execute a find in a script using a date such as 3/*/2017?
>> Whenever I try it, I get a message that "3/*/2017" is not a date.
>>
>> As usual, I'm still using FileMaker Pro 8.0v3 on a G5 running 10.5.8.
>> ,,,
>
> I got useful advice from three of the usual suspects. Thanks to all.
> However, it's clear that my question was much to imprecise. To try to
> clarify, here's an example of what I've been trying:
>
> The month that I want to use is input using a custom dialog. It's
> therefore in a global field, named DISummaryMonth. I calculate the year
> based on the assumption that the most recent of the specified months is
> meant; this value is in $SummaryYear. The following code doesn't work:
>
>    Go to Layout ("xyz")
>    Enter Find Mode []
>    Set Field [xyz::Date; Date (DISummaryMonth, "*", $SummaryYear]
>    Perform Find []
>
> The result is the error message "No records match this set of find
> requests." This isn't surprising when I display xyz::Date before
> performing the find; it is "?" and that's what is displayed in the Date
> field of layout xyz. The value xyz::Date: [?]  has also been filled into
> the specification of the Perform Find command.
>
> I hope this is clearer, I'm willing to continue to clarify as long as
> you are willing to put up with me.
>
> Charlie
>


Since you are performing a find on a Date type, this is not going to 
accept the * as wildcard. You have to rethink and look into finding a 
date RANGE. Like find every date starting from the 1st of month x 
through to the last of month x. Now I could explain (or try) how to do 
that. But somebody much smarter has done it before me.

http://help.filemaker.com/app/answers/detail/a_id/5912/~/how-to-write-a-script-that-finds-a-range-of-dates-in-filemaker-pro

-- 
Keep well, Ursus

[toc] | [prev] | [next] | [standalone]


#2811

FromHoward Schlossberg <howard@nospam.fmprosolutions.com>
Date2017-04-10 14:58 -0700
Message-ID<ocgv08$e79$2@news.motzarella.org>
In reply to#2809
On 4/10/2017 1:57 PM, Charles H. Sampson wrote:
>    Go to Layout ("xyz")
>    Enter Find Mode []
>    Set Field [xyz::Date; Date (DISummaryMonth, "*", $SummaryYear]
>    Perform Find []
>
> The result is the error message "No records match this set of find
> requests."

You are trying to make a date of something with an invalid day.  Instead 
of trying to insert something you're converting to a date, just insert 
the text... as in:

DISummaryMonth & "/*/" & $SummaryYear


Howard

[toc] | [prev] | [next] | [standalone]


#2817

FromHelpful Harry <HelpfulHarry@BusyWorking.com>
Date2017-04-11 13:51 +1200
Message-ID<110420171351137299%HelpfulHarry@BusyWorking.com>
In reply to#2811
In article <ocgv08$e79$2@news.motzarella.org>, Howard Schlossberg
<howard@nospam.fmprosolutions.com> wrote:
> On 4/10/2017 1:57 PM, Charles H. Sampson wrote:
> > 
> >    Go to Layout ("xyz")
> >    Enter Find Mode []
> >    Set Field [xyz::Date; Date (DISummaryMonth, "*", $SummaryYear)]
> >    Perform Find []
> >
> > The result is the error message "No records match this set of find
> > requests."
> 
> You are trying to make a date of something with an invalid day.  Instead 
> of trying to insert something you're converting to a date, just insert 
> the text... as in:
> 
> DISummaryMonth & "/*/" & $SummaryYear

Maybe things have improved in the newer versions of FileMaker, but in
the older ones I've always found that it complains if you try to simply
insert text values into scripted Find Requests. Even in manual Find
Requests it doesn't like the wildcards "*" or "?".

Instead you have to use a function to convert it to a date format, then
back to text, and use the Range operator "...".

In fact the older versions of FileMaker don't even like using Set Field
in such situations and instead you have to use the Insert Calculated
Result function. (This is in FileMaker 5.5 and older, I haven't yet
tried in the "newer" FileMaker 7 I recently got.)
e.g. something along the lines of

    Insert Calculated Result [xyz::Date; 
            DateToText(Date(Date(DISummaryMonth, 1, $SummaryYear)) 
            & "..." &
            DateToText(Date(DISummaryMonth + 1, 1, $SummaryYear) - 1))]

Yes, it's weird and over-complicated, but it's the only way it actually
works without error messages.

Helpful Harry  :o)

[toc] | [prev] | [next] | [standalone]


#2818

FromHoward Schlossberg <howard@nospam.fmprosolutions.com>
Date2017-04-10 19:40 -0700
Message-ID<ochfhj$l86$3@news.motzarella.org>
In reply to#2817
On 4/10/2017 6:51 PM, Helpful Harry wrote:
> In article <ocgv08$e79$2@news.motzarella.org>, Howard Schlossberg
> <howard@nospam.fmprosolutions.com> wrote:
>> On 4/10/2017 1:57 PM, Charles H. Sampson wrote:
>>>
>>>    Go to Layout ("xyz")
>>>    Enter Find Mode []
>>>    Set Field [xyz::Date; Date (DISummaryMonth, "*", $SummaryYear)]
>>>    Perform Find []
>>>
>>> The result is the error message "No records match this set of find
>>> requests."
>>
>> You are trying to make a date of something with an invalid day.  Instead
>> of trying to insert something you're converting to a date, just insert
>> the text... as in:
>>
>> DISummaryMonth & "/*/" & $SummaryYear
>
> Maybe things have improved in the newer versions of FileMaker, but in
> the older ones I've always found that it complains if you try to simply
> insert text values into scripted Find Requests. Even in manual Find
> Requests it doesn't like the wildcards "*" or "?".


Since FM 7, you can use * in a date find as the month, day, and/or year, 
or you can just use * by itself to find any date.  And set field also 
works fine in these situations without first have to convert it to a date.

There seem to be a few people here who are insisting on a search range 
or other workarounds for solutions that were introduced in FM7.  Here 
are some examples and related notes from the help module:

• To find dates in June 2014...then type 6/2014
• To find dates from July 2014 through October 2015... then type 
7/2014...10/2015
• To find dates that occur on a Friday...then type =Friday
• To find dates from the 10th through the 16th of October or November 
2014... then type {10..11}/{10..16}/2014

Note: Full or short day names (for example, Friday or Fri) are 
acceptable in day of week searches (Tuesday finds all dates that occur 
on a Tuesday)

To find any valid value for a date or time component in a date, time, or 
timestamp field, use * or leave component unspecified, while specifying 
the other components you want to find.  For example:
• 5/12/* finds the 12th day of May in any year
• 5/12 finds the 12th day of May in the current year
• *:15 finds times 15 minutes after any hour
• 1/1/* 7 PM finds timestamps in the 7 o’clock PM hour on January 1st in 
any year

• 3/*/2014 finds all dates in March 2014
• 2/* finds all dates in February of any year
• 2014 *:30 PM finds all timestamps that occured at half past any hour 
during 2014
• AM finds all times in the morning
• {4..6}:30 PM find any of the times 4:30, 5:30, and 6:30 PM
• // 3 PM finds times in the 3 o’clock hour today
• 5/2014 7 PM finds timestamps in the 7 o’clock hour in May 2014
• =Mon 2015 finds dates that occur on any Monday in 2015

[toc] | [prev] | [standalone]


Back to top | Article view | comp.databases.filemaker


csiph-web