January 1, 200521 yr 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.
January 1, 200521 yr 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)).
January 2, 200521 yr Author 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?
January 2, 200521 yr 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 []
January 3, 200521 yr Author 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!
January 5, 200521 yr Author 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!
January 6, 200521 yr Author 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!
Create an account or sign in to comment