DateAdd() function - MapBasic - 2023

MapInfo MapBasic Reference

Product type
Software
Portfolio
Locate
Product family
MapInfo
Product
MapInfo > MapBasic
Version
2023
Language
English
Product name
MapBasic
Title
MapInfo MapBasic Reference
First publish date
1985
Last updated
2023-09-12
Published on
2023-09-12T16:32:32.686312

Purpose

Use this function to add/subtract a provided value in date units from the date variable. You can call this function from the MapBasic window in MapInfo Pro.

Syntax

DateAdd (input_date, value, units)

input_date (Date): A date input parameter

value (Integer) : Positive/Negative value in date units

units (String): Date units from below values.
  • day
  • month
  • year
  • week
  • century
  • decade

Return Value

Date

Example

dim dt as date
dt = 20210524
print DateAdd(dt, 1, "year")
//returns 20220524