4 Replies Latest reply on Mar 25, 2013 12:00 PM by KeithGall

    Dates

    KeithGall

      Title

      Dates

      Post

           I am trying to write a script that allows me to find records where todays date is greater then one date field and less then another. I am using FMPro 12. 

        • 1. Re: Dates
          philmodjunk

               First see this link for examples of scripted finds:  Scripted Find Examples

               If the set field steps used with that type of script are these:

               Set Field [YourTable::Date1 ; ">" & Get ( currentDate ) ]
               Set Field [YourTable::Date2 ; "<" & Get ( currentDate ) ]

               The script will find all records where Date1 comes after today's date and where Date2 also comes before today's date.

          • 2. Re: Dates
            KeithGall

                 I appreciate the help and feel like that may help but as I enter that into my script, the calculation returns "An operator (e.g. +,- etc. ...) is expected here"

            • 3. Re: Dates
              philmodjunk

                   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.

              • 4. Re: Dates
                KeithGall

                     Thank you. That did the trick. :)