AnsweredAssumed Answered

year(get(currentdate)

Question asked by hrcap on Aug 1, 2013
Latest reply on Aug 7, 2013 by philmodjunk

Title

year(get(currentdate)

Post

      

     Evening All
      
     I currently have an auto enter calculation that ensures carried out a check on the year entered to ensure that it is not longer that 10 years ago and is not higher than the current year.
      
     How would i add to this script so that it automatically enters in the current year? I still want the script below to work just in case the user enters in a year that is different to the current year.
      
      
     Many Thanks
      
     Hadleigh
      
      
      
     Let(
      
     @Numbers = GetAsNumber( TextFormatRemove (Filter(Self; "0123456789")));
      
      
     Case(
      
     @Numbers   <  Year(Get(CurrentDate)) - 10 or //checks that the year entered is not over 10 years ago
     @Numbers    >   Year(Get(CurrentDate))  ;  //checks that the year entered is not higher than the current year
      
     TextColor ( Self ; RGB(255; 0; 0)) ;
      
     @Numbers
      
     )
      
     )

Outcomes