Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 6324 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Greetings

I need to keep an eye on our sales team's weekly numbers. How can I generate a script that finds all invoices for last week (which would theoretically be every Monday to Sunday).

Thanks!

Posted

Set Error Capture [ On ]

Enter Find Mode [ ] ... uncheck pause

Set Field [ InvoiceDate ; Let ( start = Get ( CurrentDate ) - DayOfWeek ( Get ( CurrentDate ) ) - 5 ; start & ".." & start + 6 ) ]

Perform Find [ ]

If [ not Get ( FoundCount ) ]

Show Custom Dialog [ OK ; "No records found" ]

Show All Records

End If

Posted

I would make the calculation =

Let ( [

today = Get (CurrentDate) ;

mon = today - DayOfWeek ( today - 1 ) - 6

] ;

mon & ".." & mon + 6

)

The difference comes to play on Sunday. If today is Sunday, it will still calculate the dates of LAST week, i.e. the week beginning on the Monday before last.

Posted (edited)

I assumed monsta would want the week ending that day (if on Sunday). This was poor assumption because it is possible that the day's invoices have not yet been entered, ie, sales for the day will still happen for several hours! Your calc is clearer as well. :wink2:

Edited by Guest

This topic is 6324 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.