3 Replies Latest reply: May 15, 2014 9:55 AM by Nigel Winton RSS

    Calculated Field question

    JCC _

      With the data below I need a tag name for each tape_no depending on whether it is an even or odd number. I.E., tape_no 001262 is tagged with "on" and tape_no 001263 tagged with " off". Could this be accomplished with a calculated field? I am stuck with version 4.05.  Any help is greatly appreciated. Thanks.

       

        DATE             TAPE_NO     RECORDS     TTL_CHRGS

      05/01/06     001262    1,501        353.36

      05/01/06     001263      53,497     17,224.21

      05/02/06     001264       2,423        886.38

      05/02/06     001265      97,655     38,683.97

      05/03/06     001266       1,551        579.93

      05/03/06     001267      60,378     25,262.25

        • Calculated Field question
          joey

          I always use the mod operator for even/odd.

           

          IF(MOD(TAPE_NO,2)=1,"OFF","ON")

           

           

          I'm not sure its in that old version, but I'd imagine it is.

          • Calculated Field question
            JCC _

            Just looked and I am not finding that command. I also plugged that expression in and it did not like it.  Thanks for your assistance anyway.

            • Calculated Field question
              Nigel Winton

              Hello

              I have not got time to work it out for you, but you could extract the last 2 digits from the number and see if that will divide by 2. That should determine if it is odd or even. You need to take the 2 incase of it being a ten multiple, or you could say if the last one is zero it must be even. YOu might need to bring the INT (integer) function into use to get the answer.

              Hope that gives you somethig to think about.

               

              Nigel