User Tools

Site Tools


syntax:functions:addyears

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
syntax:functions:addyears [2019/12/12 07:43] – created dmitrysyntax:functions:addyears [2021/08/30 01:54] (current) – [Arguments] craigt
Line 1: Line 1:
-=====AddYears(number_datenumber)=====+====== AddYears(dateadd_years) =====
 +Category:  Date and Time function
  
-Adds years to the date. Subtracts if the number is negative.+\\  
 +=====Description===== 
 +This function adds //add_years// number of years to //date// If //add_years// is negative, the years are subtracted.
  
-Example: +\\  
-Expression  Result  Notes  +=====Arguments===== 
-addyears(#2019-12-12, 1 |  44177 | Equivalent to 2020-Dec-12  +^Argument^Type^Description
-addyears(#2019-12-12, 0-1)   43446 Equivalent to 2018-Dec-12  |+|date|Date or Number (date serial)|A expression representing a date.  The date to add years to.
 +|add_years |Number |The number of years to be added to //date//, or subtracted if negative.|
  
-See also:+**Return value type:** Number (date serial value). 
 + 
 +\\  
 +=====Remarks===== 
 +The //date// argument can take any value or expression that evaluates to a date serial value, with or without a time portion.  Examples include:   
 +  * A date string:  #2019-12-12 
 +  * A date serial value: 43811 (the date serial for "2019-12-12"
 +  * A date value created using any of the Date/Time functions that returns a date serial value. 
 + 
 +\\  
 +=====Examples===== 
 + 
 +  addyears(#2019-12-12, 2)  //Returns 44542 (Equivalent to 2021-Dec-12.) 
 + 
 +  addyears(43811, 5)  //Returns 45683 (Equivalent to 2024-Dec-12.) 
 + 
 +  addyears(#2019-12-12, -2)  //Returns 43081 (Equivalent to 2017-Dec-12; subtract years.) 
 + 
 + 
 +\\  
 +===== See also ===== 
 +  * [[syntax:functions:addhours|AddHours(date, add_hours)]] 
 +  * [[syntax:functions:addmonths|AddMonths(date, add_months)]] 
 +  * [[https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx|MSDNCustom Date and Time Format Strings]]
  
-* [[syntax:functions:addmonths|AddMonths(date_as_number, N)]] 
syntax/functions/addyears.1576154589.txt.gz · Last modified: 2019/12/12 07:43 by dmitry

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki