Skip to content

Instantly share code, notes, and snippets.

@jaccorens
Last active August 29, 2015 14:07
Show Gist options
  • Save jaccorens/1518778c2faf1ab09c36 to your computer and use it in GitHub Desktop.
Save jaccorens/1518778c2faf1ab09c36 to your computer and use it in GitHub Desktop.
Filemaker search variables for previous week
$currentDate = Get ( CurrentDate )
$searchStart = GetAsDate ( 7 * Int ( ( $currentDate + 7 ) / 7 ) - 13 ) // previous monday from today
$searchEnd = GetAsDate ( 7 * Int ( ( $currentDate + 7 ) / 7 ) - 7 ) // previous sunday from today
$searchRange = $searchStart & "..." & $searchEnd
//FileMaker formula
@seanwalsh
Copy link

Nice. The only change I would make is the 3rd line. You've already calculated the start of the week there is no need to do double work.

$searchEnd  =  $searchStart + 6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment