Article ID: 190480
Article Last Modified on 6/9/1999
ROUND(VAL(LEFT(ALLTRIM(STR(YEAR(DATE()))),2)),0)Note that the SET("Century",1) command returns a numeric value. The ROUND() and VAL() functions have been used in the preceding code to convert the result of the LEFT() function to a numeric value with no decimal places. These two functions can be eliminated if it is acceptable for the century to be a character value.
SET CENTURY TO INT(YEAR(DATE())/100) ROLLOVER MOD(YEAR(DATE())+50,100)NOTE: Prior to using this code, please refer to the MORE INFORMATION section below to make sure this is the behavior you want.
Issue SET CENTURY TO without any additional arguments to restore the default century to the current century and ROLLOVER to the default value of the current year plus 50 years.Therefore, if the computer's system clock is set to a year in the 2000 range, it would appear that the SET("Century",1) function that returns the century should return 20. For years between 2000 and 2049, inclusive, it returns 19.
SET CENTURY ON
? DATE() && Returns the current date, note the year.
SET CENTURY TO
? SET("Century",1) && Note that this returns 19.
? SET("Century",2) && This reports the Rollover value.
Keywords: kbxbase kbprb kbpending KB190480