Progress
Language Reference


– Date Subtraction Operator

Interfaces
OS
SpeedScript
All
All
Yes

Subtracts a number of days from a date to produce a date result, or subtracts one date from another to produce an integer result that represents the number of days between the two dates.

SYNTAX

date - { days | date } 

date

An expression that evaluates to a DATE value.

days

An expression with a value of the number of days you want to subtract from a date.

EXAMPLE

This procedure finds all unshipped orders. If the promised date is more than one week ago, the procedure finds the customers who placed the order and displays the order and customer data.

r-dsub.p
DISPLAY "ORDERS SCHEDULED TO SHIP MORE THAN ONE WEEK LATE".
FOR EACH order WHERE ship-date = ?:
  IF (TODAY - 7) > promise-date
  THEN DISPLAY order.order-num order.cust-num promise-date
    (TODAY - promise-date) LABEL "Days Late".
END. 

NOTE

The date subtraction operator rounds days to the nearest integer value.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095