Add days syntax

Official Content
This documentation is valid for:

To add days to a date.

Syntax

(date-expression) + (numeric-expression)

Type Returned:
Date

Where:
date-expression
   Must be an attribute, a function or a variable.

numeric-expression
   The number of days added to the date-expression.

Description

There is no specific function for adding days to a date. Adding days to a given date is quite simple, all you have to do is use the '+' operator.

Notes

  • GeneXus verifies the resulting date in order to obtain a valid one.
  • In Microsoft SQL Server, this function takes part of the SQL sentence send to the database manager.

Examples

&Date1 = &Date1 + 7 // Adds one week to Date1 variable

Next example is available since version GeneXus X Evolution 2. To add days to a date or datetime:

&Date1 = &Date1.AddDays(7) // Adds one week to Date1 variable

See also

AddYr function

Scope

Objects   Procedure object, Transaction object, Web Panel object

See also

AddHours method
AddMinutes method





Was this page helpful?
What Is This?
Your feedback about this content is important. Let us know what you think.