Re: Find in a date range
- From: Howard Schlossberg <howard@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 25 Feb 2008 22:51:00 -0800
buck.matthew74@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.
.
- Follow-Ups:
- Re: Find in a date range
- From: buck . matthew74
- Re: Find in a date range
- References:
- Find in a date range
- From: buck . matthew74
- Find in a date range
- Prev by Date: Find in a date range
- Next by Date: Understanding Globals
- Previous by thread: Find in a date range
- Next by thread: Re: Find in a date range
- Index(es):