1 Reply Latest reply on Aug 28, 2011 10:09 PM by LaRetta_1

    Get(CurrentDate)

    MargoAnn

      Title

      Get(CurrentDate)

      Post

      I have created a field called Current Semester with the calulation

      If (Get ( CurrentDate ) ≥ Date ( 7 ; 1 ; Year ( Get ( CurrentDate ) )) and Get ( CurrentDate ) ≤ Date ( 12 ; 31 ; Year ( Get ( CurrentDate ) ) ); "First"; If (Get ( CurrentDate ) ≥ Date ( 1 ; 1 ; Year ( Get ( CurrentDate ) )) and Get ( CurrentDate ) ≤ Date ( 6 ; 30 ; Year ( Get ( CurrentDate ) ) ); "Second";""))

       

      I woud think that every record would show the value "First", since the current date on my computer ils 8/28/2011.  However, most records show "Second".

       

      Am I using this Get (CurrentDate) field incorrectly?

       

      Angie

        • 1. Re: Get(CurrentDate)
          LaRetta_1

          Try this:

          Let ( now = Get ( CurrentDate ) ;
          Case (
          now > Date ( 6 ; 30 ; Year ( now ) ) ; "First" ;
          now < Date ( 7 ; 1 ; Year ( now ) ) ; "Second"
          )
          )

          You must also check 'Do not store calculation results' in the Storage Options so it will update.  Your calculation would have worked as well if it had been set to unstored but I wanted you to see how you might handle it using Let().  It comes in particularly handy when working with Get ( CurrentDate ); less typing; less evaluations; less chance of parenthesis errors etc. Let() allows you to perform some of your calculatons right up in its variables which helps keep the thinking clearer.   :^)