4 Replies Latest reply on Aug 21, 2010 2:27 PM by LeoWeinstein

    Search by time field?

    LeoWeinstein

      Title

      Search by time field?

      Post

      How do I do a search by a time field?  Specifially, I'm making a to do list, and I want to be able to filter the list to show only items that are due now, not items due later today, for instance.

      Any suggestions welcome.

        • 1. Re: Search by time field?
          philmodjunk

          Time or time stamp? (Time stamp fields include the date as well as the time.)

          With a time field, you should be able to enter find mode and then put something like "< 11:14 AM " to find all entries with a time of 11:14 AM or earlier. There's also an option in the insert field that will insert the current time.

          This can also be done with a script and you can also filter a portal to do this as well.

          • 2. Re: Search by time field?
            LeoWeinstein

            Thanks so much, that works great.  One more question:  can a time stamp be used as part of a calculation in a script?  I'd like to make a script that would automatically advance the time stamp by an hour or a day.  Is that possible?

            • 3. Re: Search by time field?
              LaRetta_1

              An easy way to increase a timestamp is to use Time().  For example:

              TimeStampField + Time ( 12 ; 0 ; 0 ) will increase the time by 12 hours. 

              TimeStampField + Time ( 24 ; 0 ; 0 ) will increase by one full day (same time)

              TimeStampField + Time ( 0 ; 15 ; 0 ) will increase time by 15 minutes ... and so forth

              ... I find it easier than attempting to convert the amount I want to increment (hour, day etc) to seconds. So if you wish to increase a timestamp by 3 days, it might look like:

              TimeStampField + Time ( 24 * 3 ; 0 ; 0 )

              ... which clearly reads as 3 days.  You can use a global number (or preference table field) to store your incremental increase (for number of days to jump ahead, such as 3 and calculation would then become: TimeStampField + Time ( 24 * global ; 0 ; 0 ).  All combinations are possible and easy to read.

              • 4. Re: Search by time field?
                LeoWeinstein

                Thanks, LaRetta, that works very well.  Thanks to everyone who has answered my questions.  This forum is a fantastic resource.