Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

Hi all, happy new year and thanks in advance for helping with my noob question.

I have a simple income invoice that tracks checks received. How can I get a script to search for and display all records from the current calendar week (Monday-Sunday) and last calendar week? I know I can simply search with a date range like 01.03.2005...01.09.2005, but that requires inputing the specific dates for each calendar week. How do I get to automatically search for this week and last week with out requiring the user to type in the actual dates in question? I need it to automatically roll over every week without the user having to input any actual dates.

I also need a current month search script. Again it has to roll over without entering any dates.

Posted

You start by getting the current date. Calculate day of week and then the start date and end date. Use these fields in your find.

The month is similar get first day date(Month(Current date; 1; Year(Current date)). Last day is date(Month(Current date + 1; 0; Year(Current date)).

Posted

You start by getting the current date. Calculate day of week and then the start date and end date.

I'm sorry, can you be a little more specific? How do I calculate the day of the week? How do I then restrict the found set to only dates back to the previous Monday?

Posted

Start with the following fields:

Transaction Date a date field

Current Date = Get ( CurrentDate ) store as global date field

Monday Date = Current Date + Choose ( DayOfWeek ( Current Date ) ; 0 ; -6 ; 0; -1; -2; -3; -4; -5 ) store as global date field

Sunday Date = Monday Date + 6 store as global date field

Write script:

Enter Find Mode []

Set Field [Transaction Date; Monday Date & "..." & Sunday Date]

Perform Find []

Posted

Two problems:

#1 Creating the Current Date, Monday Date and Sunday Date fields as directed returns no values for those fields. Are they supposed to automatically show a value?

#2 When creating the script, Set Field should be as a calculated result right? When I fill in the calculation with [Transaction Date; Monday Date & "..." & Sunday Date] I get the error: "The specified table cannot be found".

Please help!

Posted

Bump.

Can anyone help with this, please? I know it's a simple problem, but I've tried everything and I still can't even get my fields to populate, let alone finish my script.

Thanks!

Posted

Partial success, but still need help!

I finally managed to get the Current Date, Monday Date and Sunday Date fields to properly format and populate (I was just being retarded), but I'm having trouble try the Set Field step in the script. I specify the target field to be Transaction Date, but when I specify the calculated result with Transaction Date; Monday Date & "..." & Sunday Date, I get the following error:

"An operator (e.g. +,-,*, ...) is expected here." with the semi colon after Transaction Date highlighted.

The Set Field example in FMP help is formatted the same way, so I don't understand why it's not working.

Anyone? Beuller? Thanks for the help!

This topic is 7256 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.