ML2008 Posted May 29, 2004 Posted May 29, 2004 How can I create a script to auto find all records in a date field within 3 months from today?
CoZiMan Posted May 29, 2004 Posted May 29, 2004 This is a straightforward scripting example. You can create and save a scripted find then attach that to a button. I suggest the "Script" forum if you run into issues. It's also a good idea to provide more information in the questions you ask. For instance, do we assume you have a 'Date' field that is stored with each record? If not, there are different issues to deal with.
CobaltSky Posted May 29, 2004 Posted May 29, 2004 Hello Manny, You are talking about a dynamic find here - one that changes as the date moves on. A stored find in a script will not do, as it will retain fixed criteria from the time when it was specified. Instead, I suggest that you set up a scripted procedure that builds the find criteria by referencing the system date. Eg: Go to Layout [Layout with your date field on it] Enter Find Mode [ ] Insert Calculated Result [YourDateField; GetAsText(Date(Month(Get(CurrentDate)) - 3; Day(Get(CurrentDate)) + 1; Year(Get(CurrentDate)))) & "..." & GetAsText(Date(Month(Get(CurrentDate)) + 3; Day(Get(CurrentDate)) - 1; Year(Get(CurrentDate))))] Perform Find [Replace found set] That will roll forward with the system date, so that your find will always return all records in which the entry in the 'YourDateField' field is within the range of +/- 3 months from the current system date.
bruceR Posted May 29, 2004 Posted May 29, 2004 Note that you can also use a portal for this. See the "home" layout in the Business Tracker example file.
Recommended Posts
This topic is 7817 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 accountSign in
Already have an account? Sign in here.
Sign In Now