DATESUB        Subtract specified number of days from date variable

Top  Previous  Next

Syntax:

DATESUB

[ variable ] [ const ]

Arguments:

[ variable ]

A variable containing a date in the format of mm-dd-yy.

 

[ const ]

A variable or a numeric constant representing the number of days to subtract from the date contained in [ variable ].

Options:

none

 

 

 

This script command is used to subtract a specified number of days to date variable.

 

Consider the example below where 14 days is subtract to a variable containing current date.

 

SET today = %date

DATESUB today 14

 

The number of days to subtract may also be expressed in a variable as shown below.

 

SET today = %date

SETNUM SETdays = 14

DATESUB today days

 

The %date internal variable may not be used in this command directly.

 

Related Command(s): DATEADD

See also: Using the %date, %datetime, and %time Variables