Jump to content

Script to specify find request - based on calcluated criteria


Recommended Posts

Greetings, So I have a date field which contain lots of date records. I want a button to perform a script to find only dates for this year only on the mentioned field. I am having difficulties trying to Specify a Find Request on what criteria to put.. I can easily put 2020 as a find criteria but I don't want to do this every year, so I need something like "Year(Get(Currentdate)" as a find criteria but it won't allow me giving me the error "The Value of this field must be a valid date in the range of years 1 to 4000 and should look like 25/12/2013".

So I guess my question is how to put the find criteria as today's year?

How can I do this?

Link to post
Share on other sites

You cannot enter calculations into find criteria directly. You must do:

Enter Find Mode [ ]
Set Field [ YourTable::Datefield; Year ( Get ( CurrentDate ) ) ]
Perform Find [ ]

Or do:

Set Variable [ $thisYear; Value:Year ( Get ( CurrentDate ) ) ]

and then use the variable as the find criteria in your find request.

 

---
P.S. Please edit your profile to reflect your version and OS so that we know what you can use.

  • Thanks 1
Link to post
Share on other sites
16 hours ago, comment said:

You cannot enter calculations into find criteria directly.

Thank you for clearing this out.. so you can do it in-directly using the method below. I have a lot to learn.

16 hours ago, comment said:

Set Variable [ $thisYear; Value:Year ( Get ( CurrentDate ) ) ]

and then use the variable as the find criteria in your find request.

Thanks a lot... its exactly what I need.

Link to post
Share on other sites

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.