SteveGriff Posted December 4, 2003 Posted December 4, 2003 Hi all, I'm trying to write a small script that checks if the content of a Date Field has a value that is two days over. Erm example Three records... and today's date is 12/4/03 12/2/03 12/6/03 12/4/03 I would want my script's If statement to accept 12/2/03. I hope that make sense, because I'm feeling quite funky today. Cheers, Steve Griff
Henry Posted December 4, 2003 Posted December 4, 2003 Hi Steve, Here is the solution, Go to record [First] Loop If[Today-2 = Date] set field["result", "Date"] End if Go to record [Exit after last, Next] End Loop Regards, Henry
Charles Delfs Posted December 4, 2003 Posted December 4, 2003 You can also just have an extra calculation field that would do the same thing and would be fast and searchable. cIsDue Number field): MyDate + 2 = status(currentDate) will return true, a '1' when the date is too days old. Charles
Henry Posted December 5, 2003 Posted December 5, 2003 Oh, ya, thanks for advice. Status(currentdate) is the right function to get the date. Regards, Henry
kenneth2k1 Posted December 5, 2003 Posted December 5, 2003 Hi: I suggest using a find script. That way the loop doesn't have to initially loop through all the records in the db which could take a while. Rather than explain the whole thing, I whipped up this file in a couple of minutes to give an example. It is a real simple file. Once you do the find script, your script can then do the loop stuff since the found set will be smaller than the total, and the loop won't take so much time. Ken PS!! I misread your post. Sorry. My script is greater than or equal to today - 2. But you said just two days ago. Just change the "<=" to "=" in the script and it should be fine. Find Example.zip
Recommended Posts
This topic is 7663 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