Re: Find in a date range



buck.matthew74@xxxxxxxxx wrote:
On Feb 25, 10:51 pm, Howard Schlossberg
<how...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
buck.matthe...@xxxxxxxxx wrote:

I want to create a script that will select all records in the past
week, past month, this year.
To find everything for the past seven days:

Set Variable [ $Today; get(currentdate) ]
Enter Find Mode []
Set Field [ DateField; getastext($Today-7) & "..." & getastext($Today) ]
Perform Find []

For the last complete week (Monday thru Sunday), change the Set Field
calc to:

let([
x=dayofweek($Today);
start = $Today - (5 + x);
end = $Today - (x - 1) ];
getastext(start) & "..." & getastext(end)
)

Past month:

let([
start = date(month($Today)-1; day($Today); year($Today));
end = $Today ];
getastext(start) & "..." & getastext(end)
)

Last full calendar month:

let([
start = date(month($Today)-1; 1; year($Today));
end = date(month($Today); 1; year($Today))-1 ];
getastext(start) & "..." & getastext(end)
)

I'll let you figure out the year thing.

This does not work. Let me make sure I have described things
correctly.
When I create an Order I enter into Date_Ordered field the current
date. From this I want to determine the found groups - past week, this
calendar month, this calendar year. Can you explain a better the
solution?

What do you mean when you say it doesn't work? It doesn't return the results you expected? The script doesn't run at all? FileMaker doesn't even let you exit the calc definition? Which one doesn't work? Or do none of them work?


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Howard Schlossberg
FM Professional Solutions, Inc. Los Angeles

FileMaker 8 Certified Developer
Member, FileMaker Business Alliance
.



Relevant Pages

  • Re: Control-Down/Up Arrow do not work?
    ... Howard Schlossberg ... FM Professional Solutions, Inc. Los Angeles ... Associate Member, FileMaker Solutions Alliance ...
    (comp.databases.filemaker)
  • Re: Using dates in find
    ... FM Professional Solutions, Inc. Los Angeles ... FileMaker 8 Certified Developer ... Associate Member, FileMaker Solutions Alliance ...
    (comp.databases.filemaker)
  • Re: Custom calculation better that Title Case!?
    ... Howard Schlossberg ... FM Professional Solutions, Inc. Los Angeles ... Member, FileMaker Business Alliance ...
    (comp.databases.filemaker)