9 Replies Latest reply on Jan 30, 2017 12:35 PM by kkalach

    ACTUAL AGE

    kkalach

      Good afternoon, last year I redid our database.  I created a field for actual age and used this formula

       

      Year (Get ( CurrentDate )) - birthday year

       

      now that we have changed to 2017 the ages did not increase by a year.   If I go into the database and retype the year it will change to the correct age.  I don't want to have to go through our entire data base and retype the year of birth.

       

      Can anyone help out with this

       

      Thank you for your help!

      Karen

        • 1. Re: ACTUAL AGE
          siplus

          Is the formula you used stored ? It should not be.

           

          In our software the age is an unstored calc defined as:

           

          Let ( [

           

          C = Get ( CurrentDate ) ;

          yC = Year ( C ) ;

          mC = Month ( C ) ;

          dC = Day ( C ) ;

          doyC = DayOfYear ( C ) ;

           

          B = Date of birth ;   // <---- this is the field holding the patient's date of birth.

          yB = Year ( B ) ;

          mB = Month ( B ) ;

          dB = Day ( B ) ;

          doyB = DayOfYear ( Date( mB ; dB ; yC ) ) ;

           

          num_years = ( yC - yB - ( doyC < doyB ) ) ;

          num_months = Mod ( mC - mB - (dC < dB ) ; 12 ) ;

          num_days = C - Date ( mC - ( dC < dB ) ; dB ; yC ) ] ;

           

          TextStyleAdd(num_years;Bold) & " Y, "  &  TextStyleAdd(num_months;Bold)  & " M, "  & TextStyleAdd(num_days;Bold) & " D")

          1 of 1 people found this helpful
          • 2. Re: ACTUAL AGE
            kkalach

            What do you mean stored.  The formula is under specified value

             

            Karen Kalach

             

            Assistant to Bill Mann

             

            LPL Financial

             

            203-271-3192

             

            www.thefinancialarchitect.net<http://www.thefinancialarchitect.net>

            • 3. Re: ACTUAL AGE
              philmodjunk

              If this is a field with an auto-entered calculation, it will not update automatically.

               

              If it it is a field of type calculation, open the calculation in the calculation editor, click storage options and select the "do not store..." option.

              • 4. Re: ACTUAL AGE
                siplus

                Screen_Shot_2017-01-26_at_21_14_12.png

                2 of 2 people found this helpful
                • 5. Re: ACTUAL AGE
                  kkalach

                  field is a number type and did a calculation in validated by calculation

                   

                  Karen Kalach

                   

                  Assistant to Bill Mann

                   

                  LPL Financial

                   

                  203-271-3192

                   

                  www.thefinancialarchitect.net<http://www.thefinancialarchitect.net>

                  • 6. Re: ACTUAL AGE
                    siplus

                    in your first post you wrote

                     

                    I created a field for actual age and used this formula

                    Year (Get ( CurrentDate )) - birthday year

                     

                    and now you're talking about validated by calculation in a simple number field, which is a totally different beast.

                    • 7. Re: ACTUAL AGE
                      jormond

                      Validation is only used to determine if you want to allow the value or not. If the value is updating as you say, it is likely a number field with an auto enter calculation.

                       

                      You need to change it to a calculation, unstored with a number result. The options in the field calculation dialog should look something like this:

                      Screen_Shot_2017-01-26_at_4_12_39_PM.png

                      2 of 2 people found this helpful
                      • 8. Re: ACTUAL AGE
                        philmodjunk

                        My guess is that KKalach set up an auto-enter calculation into that number field. As I stated before, this won't update like you need.

                         

                        Change the field type to calculation--you won't even need to re-enter the calculation. And then open the editor and change the storage options as we have directed you to do.

                        • 9. Re: ACTUAL AGE
                          kkalach

                          Thank you all very much.  Changing to a calculation worked great.  I am using an already created database that I was not involved with.

                           

                           

                           

                          You guys are a great resource.

                           

                          Karen Kalach

                           

                          Assistant to Bill Mann

                           

                          LPL Financial

                           

                          203-271-3192

                           

                          www.thefinancialarchitect.net<http://www.thefinancialarchitect.net>