November 16, 201015 yr I work for a small arts council and am creating a task database to manage a parade of volunteers and staff. My task records all have a due date (usually calculated). I can't believe I haven't been able to successfully write a find script that gathers tasks due in the next week, in the next month, and so on. I presume one starts with today's date and creates a range that includes today's date plus a number of days, But I've done the "// + 7" thing six ways from Tulsa and can't get it to work. Thanks in advance for stopping a relative newbie from thrashing about.
November 16, 201015 yr In your script you will want to perform a Find step with a calculation for the Due Date field. 1. If this is within 1 week of the current date use: Get(CurrentDate) & ".." & Get(CurrentDate) + 6 2. If you want to find all records with due dates from last Sunday to next Saturday: Get(CurrentDate) - DayOfWeek(Get(CurrentDate)) +1 & ".." & Get(CurrentDate) - DayOfWeek(Get(CurrentDate)) + 6
November 16, 201015 yr Author Thanks Matthew. I'll try today. Learning the syntax of calculations seems to be an uphill climb for me. Thanks!
November 18, 201015 yr Author I've tried your solution and it seems to work going forward, but it also seems to gather records prior to today. I don't get it yet I guess. By the way, are you describing a range, meaning an elipsis (3 periods) between the quotes? Edited November 18, 201015 yr by Guest
November 18, 201015 yr There isn't much we can do with this if you won't actually tell us exactly what you are doing. Please post an example file or an exact copy of your script.
November 18, 201015 yr Author Here's what I've got so far: Find tasks for next 30 days script- Go to Layout ["Task Printing" (TASKS)] Show all Records Enter Find Mode [] Set Field [TASKS::TaskDueDate; Get(CurrentDate) & "..." & Get(CurrentDate) + 30 Perform Find [] Sort Records [specified Sort Order:TASKS::Staff; ascending TASKS::Projects; ascending TASKS::status; ascending [Restore; No dialog] I'm trying to get this to work because I'll have one more level of complication when I also in the same script ask it to also gather tasks flagged as "Overdue"
December 6, 201015 yr Author There isn't much we can do with this if you won't actually tell us exactly what you are doing. Please post an example file or an exact copy of your script. I posted the script. Any interest in telling me what I'm doing wrong? Thanks, Doug
December 6, 201015 yr Any interest in telling me what I'm doing wrong? I have never, ever had a problem finding people to tell me what I'm doing wrong. :
December 6, 201015 yr Author I have never, ever had a problem finding people to tell me what I'm doing wrong. : Perfect response! I posted a reply because it seemed that you were the only one vaguely interested in solving my little conundrum. I am not finding the resources in books and online help that deal with fundamental concepts in a way that covers my particular problems. Of course, it is possible that I haven't enough brain cells. I'm hoping that's not the case. D
December 6, 201015 yr I have never, ever had a problem finding people to tell me what I'm doing wrong. : Ain't that the truth, LOL. Lee
December 6, 201015 yr Set Field [TASKS::TaskDueDate; Get(CurrentDate) & "..." & Get(CurrentDate) + 30 Have you double-checked that the TaskDueDate field is actually set to be of type Date instead of Text or something?
December 9, 201015 yr I've checked your script and it should work... So, here are the things you should check - 1 - add a pause (temporarily)after you set your field and before you actually perform the find - this will ensure that you have the calculation correct... Second - as discussed earlier - make certain that this Date field is actually formatted as a Date Type. Third - and this is probably what it is - make certain that the index is not corrupted on this field - I have recreated indexes in the past by turning off indexing on the field and then turning it back on. One of these should resolve your problem...
December 9, 201015 yr Author I've checked your script and it should work... So, here are the things you should check - 1 - add a pause (temporarily)after you set your field and before you actually perform the find - this will ensure that you have the calculation correct... Second - as discussed earlier - make certain that this Date field is actually formatted as a Date Type. Third - and this is probably what it is - make certain that the index is not corrupted on this field - I have recreated indexes in the past by turning off indexing on the field and then turning it back on. One of these should resolve your problem... Thanks Keith!
Create an account or sign in to comment