webCOMAND

ADDDATE()

Add a positive or negative number of days to a date.

Prototype

mixed ADDDATE(mixed $date, integer $days)

Parameters

  • date - A date (YYYY-MM-DD) or timestamp (YYYY-MM-DD HH:MM:SS) in format.
  • days - A positive or negative number of days to add to the current date.

Return

If a date is provided, the adjusted date string is returned.  If a timestamp is provided, the adjusted timestamp string is returned.  If there is an error, such as an invalid date, NULL is returned.

Example

SELECT OID, Date, ADDDATE(Date, 30) AS DueDate FROM Invoice