Xbasic

- (Date Subtraction)

Syntax

Result as D = Operand1 as D - Days as N

Days as N = Operand1 as D - Operand2 as D

Arguments

Operand1

A date value.

Operand2

A date value.

Days

A number.

Description

Date subtraction produces a date value or number by subtracting an integral or fractional number of Days from Operand1.

Example

dim start as D
dim end as D
start = {11/25/95}
? start - 30
= {10/26/95}
end = {1/1/96}
start = {1/1/96}
? end - start
= 364
? CTOD('11/25/95') - CTOD('5/2/95')
= 207

See Also