Validation Constraint on Data Entry

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MMcCarthy
    Recognized Expert MVP
    • Aug 2006
    • 14387

    Validation Constraint on Data Entry

    Hi guys

    Quick question. How can you add a validation constraint that allows null values.

    For example if you want to impose an 8 char length to the value entered in a field how can you do this but still allow for null record.

    Mary
  • ck9663
    Recognized Expert Specialist
    • Jun 2007
    • 2878

    #2
    Allow when:

    Code:
    YourColumn IS NULL or len(rtrim(ltrim(YourColumn))) = 8


    -- CK

    Comment

    • MMcCarthy
      Recognized Expert MVP
      • Aug 2006
      • 14387

      #3
      Thanks a million for your reply. Sorry it took so long for me to get back to you, I have been under a little deadline pressure. :)

      Comment

      • ck9663
        Recognized Expert Specialist
        • Jun 2007
        • 2878

        #4
        Although this is advisable to be created on your table, it wouldn't hurt to place same checks on your front-end. In that way, your server does not need to process something that the front-end have already flagged as invalid entry.

        -- CK

        Comment

        • MMcCarthy
          Recognized Expert MVP
          • Aug 2006
          • 14387

          #5
          Thanks CK. Unfortunately, we're dealing with an awkward client here who insists on retaining the option of being able to enter data directly into the tables. The validation checks are on the data entry forms already but unfortunately this won't help with data being entered directly in the table.

          Appreciate the advice though.

          Mary

          Comment

          • theine
            New Member
            • Aug 2008
            • 4

            #6
            I've set up to validate each cell entry to prevent duplicate entries. Tested it by typing in the repeated number and a unique number both gave me the correct results.

            When I copy and paste into the validated cells, it doesn't validate the entries.
            Why's this?

            Comment

            • ck9663
              Recognized Expert Specialist
              • Jun 2007
              • 2878

              #7
              Originally posted by theine
              I've set up to validate each cell entry to prevent duplicate entries. Tested it by typing in the repeated number and a unique number both gave me the correct results.

              When I copy and paste into the validated cells, it doesn't validate the entries.
              Why's this?

              Are you talking about the same issue?

              -- CK

              Comment

              Working...