User Guide

158
Chapter 7
Select Type of Calculation to Perform with Date/Time Variables
Figure 7-21
Add or subtra
ct values from date/time variables, step 1
Add or s
ubtract a duration from a date.
Use this option to add to or subtract from
a date-format variable. You can add or subtract durations that are fixed values
like 10 days, or the values from a numeric variable—for example, a variable
that re
presents years.
Calcu
late the number of time units between two dates.
Usethisoptiontoobtainthe
difference between two dates as measured in a chosen unit. For example, you can
obtain the number of years or the number of days separating two dates.
Subtract two durations. Use this option to obtain the difference between two
varia
bles that have formats of durations—such as hh:mm or hh:mm:ss.
Note: Tasks are disabled when the data set lacks the types of variables required to
accomplish the task. For instance, if the data set lacks two variables with formats of
durat
ions, then the task to subtract two durations does not apply and is disabled.