In article <HJqdneTXGP8EZWjdRVn-ig (AT) look (DOT) ca>, "Jay"
<azuraboom (AT) hotmail (DOT) com> wrote:
Quote:
Designing a report to pull off all transactions during a given month
(current month). I have a field that is the creation date and I want to
find all the records that match...
any help would be appreciated.
jay |
Since the "current month" obviously changes you'll need to perform the
Find within the script rather than storing it.
It's fairly easy to use the appropriate commands in the same way you
manually perform a Find ... an exception is that Date fields are a bit
buggy, so you can't use the Set Field command. Instead you have to use
Insert Calculated Result command and "play" with the the format by
using the DateToText function.
You'll also need some error checking in there to see if any records
were actually found. This means your script becomes something like:
Enter Find Mode []
Insert Calculated Result [CreationDateField,
DateToText(
Date(
Month(Status(CurrentDate)),
1,
Year(Status(CurrentDate))))
& "..." &
DateToText(
Date(Month(Status(CurrentDate)) + 1,
0,
Year(Status(CurrentDate))))]
Set Error Capture [On]
Perform Find []
If [Status(CurrentFoundCount) = 0]
Show Message ["No records found"]
else
{print report}
End If
The first Date function works out the start of the current month,
ie. current month / 1 / current year
The second Date function works out the end of the current month. By
adding one to the current month and using the day "0", FileMaker
realises you really want the last day of the previous month.
ie. next month / 0 / current year
is the same as current month / last day / current year
that way you don't have to work out how many days are actually in the
current month.
Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)