February 10, 200520 yr Newbies 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!
February 10, 200520 yr 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
February 11, 200520 yr "today minus 3 years (to the exact date)" So if today was 29 February 2004, what date should the calculation return?
February 11, 200520 yr Author Newbies 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!
February 11, 200520 yr You might be better off using a number of short scripts which are called by your main script. Sort of like using subroutines.
Create an account or sign in to comment