6 Replies Latest reply: Jan 7, 2015 4:11 PM by Leo Catt RSS

    On Time v Overdue

    Leo Catt

      Hi Everyone,

      I am trying to calculate Records by comparing Today is Greater than (Less Than) a due date.  this is what I have, but Im getting errors.

       

      Any suggestions?

       

       

      if(Today()) > [Calculated Eval Due], 'Overdue', 'OnTime' as EVAL_ONTIME;

       

        • Re: On Time v Overdue
          Jared Papador

          Check your syntax:

           

          if(Today() > [Calculated Eval Due], 'Overdue', 'OnTime') as EVAL_ONTIME;

           

          should look like that, moved the ) from today to end of if statement

          • Re: On Time v Overdue
            Ian Tsang

            Hi Leo

             

            you to need to close your if statement:

             

            if(Today()) > [Calculated Eval Due], 'Overdue', 'OnTime') as EVAL_ONTIME;





            • Re: On Time v Overdue
              Colin Albert

              Can you check that [Calculated Eval Due] is a correctly formatted date?

              The simplest way is to add the field to a listbox and see if the values are shown as dates or numbers, and whether  the data is left or right justified.

               

              If shown as a date, but right justified, the value is correctly held as a dual field and will match the data returned by today()

               

              If shown as a date but left justified, then the value is held as text and you will need to use something like

                   Date(date#([Calculated Eval Due], 'DD/MM/YYYY'))  

              replacing DD/MM/YYYY with your actual date format to convert the data to a correct date value.

               

               

              If shown as a number then date([Calculated Eval Due]) should convert the data to a correct date format.