Newbies BernieR Posted February 10, 2005 Newbies Share Posted February 10, 2005 I am trying to write a script that will find records when looking in a date field (formatted as date) that is today minus 3 years (to the exact date). I have to run this every month. Help is appreciated! Link to comment Share on other sites More sharing options...
-Queue- Posted February 10, 2005 Share Posted February 10, 2005 Allow User Abort [Off] Set Error Capture [On] Enter Find Mode [ ] Set Field [datefield; Let( T = Get(CurrentDate); Date( Month(T); Day(T); Year(T) - 3 ) )] Perform Find [ ] If [not Get(FoundCount)] Show Custom Dialog ["No records for that date exist."] End If Or create an unstored calculation date field of Let( T = Get(CurrentDate); Date( Month(T); Day(T); Year(T) - 3 ) ) and a relationship from this field to your date field. Then a script like If [isEmpty(relationship::serial)] Show Custom Dialog ["No records for that date exist." Else Go to Related Record [show only related; "relationship"] End If Link to comment Share on other sites More sharing options...
Vaughan Posted February 11, 2005 Share Posted February 11, 2005 "today minus 3 years (to the exact date)" So if today was 29 February 2004, what date should the calculation return? Link to comment Share on other sites More sharing options...
Newbies BernieR Posted February 11, 2005 Author Newbies Share Posted February 11, 2005 It worked - thanks a million! Is there any good resource for scipts that give examples? I used to do a bit of Visual Basic but it's been a while...there's lots of other parts to this project I want to put together in one script. Thanks for your help! Link to comment Share on other sites More sharing options...
RalphL Posted February 11, 2005 Share Posted February 11, 2005 You might be better off using a number of short scripts which are called by your main script. Sort of like using subroutines. Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 6617 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