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

Trying to create a find script returning records from next 30 days


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

Recommended Posts

Posted

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.

Posted

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

Posted (edited)

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 by Guest
Posted

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.

Posted

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"

  • 3 weeks later...
Posted

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

Posted

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. :

  • Like 1
Posted

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

Posted

I have never, ever had a problem finding people to tell me what I'm doing wrong. :)

:

Ain't that the truth, LOL.

Lee

Posted

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?

Posted

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...

Posted

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!

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