613-518-1166 info@zimdatabases.com

ZIM Language Reference

$addweeks

< All Topics

$addweeks

Calculates a date value by adding weeks to (or subtracting weeks from) a specified date value.

Syntax

$addweeks(date,number)

Parameters

date

a date, or an expression that evaluates to a DATE data type

number

a number, or an expression that evaluates to a number

Return Value

Number, representing a DATE value.

Comments

Use $addweeks to perform arithmetic with date values. The $addweeks function calculates a date value by adding a number representing weeks to a date value. If number is negative, the effect is to subtract the weeks from the date.

The + (add) and – (subtract) operators can be used to achieve the same results.

If date or the result of the $addweeks expression is an invalid date (e.g., 19930231), it is adjusted to produce a valid date (e.g., 19930228).

Example

If $Date has the value 19981225, then

$addweeks($date,1)

Evaluates to 19990101.

$addweeks($date,-2)

Evaluates to 1998.501.

$addweeks(19980201,4)

Evaluates to 19980301.

 

See Also

$adddays

$addmonths

$addyears

$todate

$weekday

+ (Add/Positive)

– (Subtract/Negative)

About Functional Expressions

Arithmetic with Dates

Was this article helpful?
0 out Of 5 Stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
How can we improve this article?
Table of Contents