portableSql

AddMonthsToDateTime Portable SQL Function

Syntax

AddMonthsToDateTime as T (DateTime as T, NrOfMonths as N)

Arguments

DateTimeTime

A field or value.

NrOfMonthsNumeric

Number of months to add.

Returns

resultTime

Returns a date NrOfMonths ahead of DateTime.

Description

Get the date and time value NrOfMonths months ahead of DateTime.

Discussion

The AddMonthsToDateTime function computes a new date by adding months to a datetime field.

AddMonthsToDateTime() function executed on the Northwind Access database
SELECT FIRST 1 CurrentDateTime() AS Now, AddMonthsToDateTime(CurrentDateTime(), 4) AS Expr1 FROM Orders
=10/10/2019 12:48:35 00 pm|02/10/2020 12:48:35 00 pm