2 Replies Latest reply on Oct 14, 2014 2:37 AM by ChristofferRexen_1

    Finding records +30 Days

    ChristofferRexen_1

      Title

      Finding records +30 Days

      Post

      Hi everyone

      This might seem like a fairly simple question, but I'm still having trouble.

      Se attached image of the script.

      I want to find a bunch of records which is less or equal todays date +30 days.

      Although my script seems to find records which surpasses that find criteria.

      Any thoughts of what I am doing wrong?

      P.S. I know you guys like the find criteria to be visible by "Set Field" and not in the "Perform Find"

      Sk%C3%A6rmbillede_2014-10-13_kl._11.15.09.png

        • 1. Re: Finding records +30 Days
          philmodjunk

          We like it for a reason.

          For one thing I see Restore twice in your script but cannot tell from the script listing what stored criteria might exist in either step. Another reason is that you can do things with Set Field to set up a find that can't be done with stored criteria and this type of calculated find criteria is an example of that.

          Then your set field step appears to be missing a parameter.

          When Setting up Set Field, there are two Specify buttons that must be clicked. To get Set Field [Table::Field ; Expression], add set field to your script and click the first button (specify target field). Select Table::Field from the list of fields. Do not click the specify button next to the repetition box. Click OK to close this dialog box. Now click the lower specify button (calculated result) and create the expression to the right of the semicolon (;). Do not try to type in the semicolon.

          The script that I would use:

          Enter Find Mode []
          Set Field [Pension_medarbejder::Pensiondato ; "<" & Get ( CurrentDate ) + 30 ]
          Set Error Capture [on]
          Perform Find[]

          This script can still fail if Pensiondato is not a field of type date.

          For more examples of scripted finds, see: Scripted Find Examples

          • 2. Re: Finding records +30 Days
            ChristofferRexen_1

            Thanks alot Phil!

            The Script works as a charm now.

            - Even better with the Scripted finds, i'm sure I'll find something I can use there.

            Have a good one!