Beispiel :

Code:
d t1              s               z   inz(z'2002-12-02-01.01.01.000100')
d t2              s               z   inz(z'2002-12-02-01.01.01.000010')
d t3              s             20p 6

c/Exec SQl
c+   set :t3 = :t1 - :t2
c/End-exec

c                   eval      *inLr = *on
c                   return
Ergebnis :

T3 = 00000000000000.000090

Aus dem Handbuch:

Zitat:

Timestamp duration

A timestamp duration represents a number of years,
months, days, hours, minutes, seconds, and
microseconds, expressed as a DECIMAL(20,6)
number. To be properly interpreted, the number
must have the format yyyymmddhhmmsszzzzzz,
where yyyy, mm, dd, hh, mm, ss, and zzzzzz
represent, respectively, the number of years,
months, days, hours, minutes, seconds, and
microseconds. The result of subtracting one
timestamp value from another is a timestamp
duration.
[/quote]