User Tools

Site Tools


syntax:functions:addmonths

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
syntax:functions:addmonths [2019/12/12 07:43] dmitrysyntax:functions:addmonths [2021/08/30 01:52] (current) – [Arguments] craigt
Line 1: Line 1:
-===== AddMonths(date_as_numberN) =====+====== AddMonths(dateadd_months) =====
 +Category:  Date and Time function
  
-Adds //N// months to date represented as number. //N// can be in range from -10000 to 10000.+\\  
 +=====Description===== 
 +This function adds //add_months// number of months to //date// If //add_months// is negative, the months are subtracted.
  
- Example   Result   Notes  +\\  
-addmonths(42097, 3 |  42188  |  42097 corrensponds to April 4th, 2015  +=====Arguments===== 
-addmonths(42097, 0-3)   42007   42097 corrensponds to April 4th2015  |+^Argument^Type^Description
 +|date|Date or Number (date serial)|A expression representing a date.  The date to add months to.
 +|add_months |Number |The number of months to be added to //date//or subtracted if negative.|
  
-Notekeep in mind that EasyMorph doesn't support unary minus in expressions - see Example 2 above.+**Return value type:** Number (date serial value).
  
-See also:+\\  
 +=====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.
  
-* [[syntax:functions:addyears|AddYears(number_datenumber)]]+\\  
 +=====Examples===== 
 + 
 +  addmonths(#2019-12-12, 2)  //Returns 43873 (Equivalent to 2020-Feb-12.) 
 + 
 +  addmonths(43811, 5)  //Returns 43963 (Equivalent to 2020-May-12.) 
 + 
 +  addmonths(#2019-12-12, -2)  //Returns 43720 (Equivalent to 2019-Oct-12; subtract months.) 
 + 
 + 
 +\\  
 +===== See also ===== 
 +  * [[syntax:functions:addhours|AddHours(date, add_hours)]] 
 +  * [[syntax:functions:addyears|AddYears(dateadd_years)]] 
 +  * [[https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx|MSDN: Custom Date and Time Format Strings]]
syntax/functions/addmonths.1576154634.txt.gz · Last modified: 2019/12/12 07:43 by dmitry

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki