2 Replies Latest reply on Aug 17, 2011 8:56 AM by philmodjunk

    Date search AND omit records



      Date search AND omit records


      Hi all,


      I made a script that finds records in a given date range (using "StartDate" and "EndDate" with a "Insert Calculated Result").

      This works all fine.

      But I also have a field "Example" that can have the value A, B or C.

      If I want to make a report (with the date search included) that either omits all records that have lets say value C, or a report that includes only records of value A...how do I do it?

      If I try to add any Omit to my "Perform Find" in the script, it breaks the date search.



        • 1. Re: Date search AND omit records

           Make it two searches chained together in the script:

          First, do your date search as usal.

          Then have another find immediately after that goes like:

          Enter Find Mode
          Setfield (yourfield ; "C" )  <-----or a value from some other field you set
          Omit Record


          • 2. Re: Date search AND omit records

            Use this script:

            Enter Find Mode[]
            Set field [Yourtable::YourdateField ; Table::gDate1 & "..." & Table::gDate2 ]
            new record/request
            Set field [Yourtable::Example ; //put Value C here]
            Omit Record
            Set Error Capture [on]
            Perform Find[]

            I'm assuming you use a pair of global date fields, gDate1 and gDate2 are used to produce your date range. Other date range expressions are also possible here.