4 Replies Latest reply on Oct 12, 2010 3:04 PM by LaRetta_1

    Date validation

    GHM

      Title

      Date validation

      Post

      Hi

       

      I would be grateful for some help with the following...

       

      I have a table with 2 dates, DateA and DateB with drop down calendars for data entry. I would like to validate the dates entered to ensure that:

       

      1. DateA's date may be less or equal to todays date and

      2. DateB's date may be equal to or greater than DateA 

       

      Thanks

       

      Geoff 

        • 1. Re: Date validation
          TSGal

          Geoff:

           

          Thank you for your post.

           

          After you create DateA, click the "Options..." button.  FileMaker takes you to a new dialog box.  Click on the "Validation" tab, and check the option "Validated by calculation".  You are now taken to a calculation dialog box.  In the calculation formula area, enter:

           

          DateA ≤ Get (CurrentDate)

           

          That is, this makes sure that DateA is less than or equal to today's date.

           

          Click "OK" to return the field options.  At the top of that screen, under "Validate data in this field", select "Always".  Also, unless you want the ability to override the entry, uncheck the option "Allow user to override during data entry".  This forces the user to always put in dates that meet the criteria.

           

          Click "OK" to return to the Fields dialog box.

           

          Follow the same steps above for DateB, except in the calculation formula area, enter:

           

          DateB ≥ DateA

           

          Now, you will be able to enter any data you want, and when you try to commit the record, FileMaker will perform the evaluation on this field, and if the criteria is not met, and error message will appear.

           

          TSGal

          FileMaker, Inc. 

          • 2. Re: Date validation
            GHM
              

            Thank you, TSGal

             

            Geoff

            • 3. Re: Date validation
              ChristineT.

              TSGal,

              I am trying to solve the exact same issue and I have a follow-up question:

              I can get the "DateB ≥ DateA" validation to work, but how do you tell it:

              DateB ≥ DateA  unless DateA is empty, then don't evaluate/don't show the error message

              ?

              I have a series of due dates that I need to daisy-chain in this manner. It works fine if I enter all the dates at once, but some fields will remain blank until the user inputs the due date. Right now the user tries to enter the DateA date, but gets an error if DateB is blank.

              Thanks,

              CT

              • 4. Re: Date validation
                LaRetta_1

                Validation should be:

                DateB ≥ DateA or IsEmpty ( DateA )