2 Replies Latest reply on Mar 27, 2009 10:13 AM by raybaudi

    Find Previous Day in a Script

    ChronoVII

      Title

      Find Previous Day in a Script

      Post

      How would you search for the previous day in a script?

       

      For example, today is 3/27/09, I want to find records from 3/26/09

       

      Thanks

        • 1. Re: Find Previous Day in a Script
          philmodjunk
            

          Let's call your date field something original like "DateField".

           

          Then a script like

           

          Set Variable [$Date,DateField]

          Enter Find Mode[]

          Set Field [DateField,$Date-1]

          Perform Find

           

          Will find all records dated one day earlier than the date stored in DateField.

           

          A very useful concept to keep in mind is that date fields are really number fields with special built in formatting that displays the number of days from 0/0/0000 in a date format we humans can read. Since it is really a number, you can usually treat it like one in expressions and scripts.

          • 2. Re: Find Previous Day in a Script
            raybaudi
              

            ChronoVII wrote:

             

            How would you search for the previous day in a script?


            Hi ChronoVII

             

            if you want to find all record of yesterday:

             

            Enter Find Mode [ ]
            Set Field [ yourDateField ; Get ( CurrentDate ) - 1 ]
            Perform Find [ ]