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

Find by date variable

Featured Replies

Hi,

I have a bunch of records that each have a target date field. Is there a way that I can dynamically find the records that have a target date in the next 7 days? I can't hardcode any dates in there.

I know I can find target dates after today by finding records where the date > //, but I can't seem to omit < // + 7 or do any date manipulation with dates in the find criteria.

Thanks.

-Chris

Hi

you have to make 2 requests !

You can do it in find mode, with the first request being >// and the second being >12/06/2005 (omitt).

For repetitive tasks it will be better to make a script !

  • Author

Right, I see how that works, but I can't enter 12/6/2005 because this script will run everyday so I can't hardcode the date for the omit cutoff. Is there another way to make this work?

Try:

Enter Find Mode []

Set Field [ yourTable::yourDatefield ; Get (CurrentDate) & ".." & Get (CurrentDate) + 7 ]

Perform Find []

  • Author

Perfect. Thanks!

I am still learning scripts. I went in and wrote this script that you gave for an example and I keep getting errors. This is what I am getting.

An operator (e.g.+,-,*,...) is expected here. It highlights everything from Get(CurrentDate) to the end of it.

I am in scriptmaker and I double click SetField then I go to calculation and type everything in that you gave the example for. What am I doing wrong? Thank you.

You are probably pasting in the brackets "[" "]", you only need to paste this:

Get (CurrentDate) & ".." & Get (CurrentDate) + 7

In the calculation box.

HTH

Lee

I think it's a pretty common error at first ...

Everything inside the Set Field is being placed in the calc box, even according to his description of what he is doing "I double click SetField then I go to calculation", as:

yourTable::yourDatefield ; Get (CurrentDate) & ".." & Get (CurrentDate) + 7

You need to FIRST select Specify Field and enter your field name as indicated by everything before the first semi-colon. Only the last portion AFTER the semi-colon should be put in the calc box as Lee indicated, or:

Get (CurrentDate) & ".." & Get (CurrentDate) + 7

Thank you. That worked when I just put in the Get (CurrentDate) so forth.

I was going by the first script that showed to put in the table and the field so I put the folloing.


Set Field[]



Then I clicked on calculation and put this in:



Rifles::Date Sold;Get(CurrentDate)&".."& Get(CurrentDate)+ 7

That is when the error popped up. It looks like it works without the Rifles::Date Sold. But what would happen if I needed it in there? Is there another way to do it?

"it works without the Rifles::Date Sold. But what would happen if I needed it in there? "

As I explained above there are TWO parts to a Set Field[] script step:

[color:red]1) The field to set (button says Specify Target Field)

[color:blue]2) Set with what (button says Calculated Result)

Set Field [ [color:red]yourTable::yourDatefield ; [color:blue]Get (CurrentDate) & ".." & Get (CurrentDate) + 7 ]

LaRetta :wink2:

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.