Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

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

Featured Replies

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.

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

  • Author

Thanks Matthew. I'll try today. Learning the syntax of calculations seems to be an uphill climb for me. Thanks!

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

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.

  • 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"

  • 3 weeks later...
  • 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

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

  • 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

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

:

Ain't that the truth, LOL.

Lee

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?

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

  • 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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.