Calculates a new date that is based on a date expression and a reference date.

NewDate := CALCDATE(DateExpression [, Date])

Parameters

DateExpression

Type: Text, Code, or DateFormula

The date expression can be any length. The string is interpreted from left to right with one subexpression at a time. The following rules describe the valid syntax of date expressions:

  • DateExpression = [<SubExpression>][<SubExpression>][<SubExpression>]

  • <SubExpression> = [<Sign>] <Term>

  • <Sign> = + | -

  • <Term> = <Number><Unit> | <Unit><Number> | <Prefix><Unit>

  • <Number> = Positive integer

  • <Unit> = D | WD | W | M | Q | Y (D=day, WD=weekday, W=week, M=month, Q=quarter, Y=year)

  • <Prefix> = C (C=current)

These production rules show that date expressions consist of zero, one, two, or three subexpressions. Each subexpression comprises an optional sign and a term. The following are some typical examples of terms:

  • 30D (30 days; corresponds to <Number><Unit>)

  • WD2 (weekday number 2; corresponds to <Unit><Number>)

  • CW (current week; corresponds to <Prefix><Unit>)

The internal calendar of C/SIDE starts on Monday and ends on Sunday. This means that Monday is weekday 1 and Sunday is weekday 7.

A run-time error occurs if the syntax of DateExpression is incorrect.

Date

Type: Date

Use this optional parameter to define a reference date. The default is the current system date.

If you omit this optional value the current system date is used.

Expand imageProperty Value/Return Value

Expand imageRemarks

Expand imageExample 1

Expand imageExample 2

Expand imageSee Also