1 Reply Latest reply on Mar 20, 2012 10:09 PM by philmodjunk

    How to validate a field with a date



      How to validate a field with a date


      Hi, Im working on making a inventory and stock management database. I have a field where you must put the "best if sold by" date and what I want is that it has al least 2 months of freshness. So Im trying to do a validation by calculation for the "best is sold by" field, but I dont how to make the calculation... what I´ve tryied but didnt work was: s


      Getasnumber (Fecha Ingreso) < getasnumber (fecha de caducidad) + 60 , but it didn´t work.

      Fecha Ingreso: the date when the record was made (Auto-entry, creation date)

      Fecha caducidad: "best if sold by" date (User must enter this date)


      The main objetive is not to allow users to recieve product that has at least 2 months of freshness, hope someone can help... Thanks!

        • 1. Re: How to validate a field with a date

          Fecha Ingreso and fecha de caducidad must be either fields of type date or calculation fields that return a "date" data type.

          Fecha Ingreso < ( fecha de caducidad+ 60 )

          will return a value of True (1) if the creation date is less than the "Sold by" date + 60 days. If you are using this expression to identify product that is good to sell if the "sold by date" is 60 or more days later than the creation date, You should use:

          ( Fecha Ingreso + 60 ) < fecha de caducidad