NicC wrote:I think you can use the DAYS builtin function - convert both, subtract and then another BIF (same section of the manual) to convert the result back to time. Something like
diff = days(ts1) - days(ts2)
ans = ????(diff)
Don't "think you can use", if you had RFTM, you would have known that the DAYS builtin is useless for DB2 timestamps, none of the PL/I builtin functions supports the "YYYYMMDDHHMISS999999" format of DB2 timestamps!
You need extended float (i.e. FLOAT DEC (33), or FLOAT DEC(34) for DFP)) to cater for the full range of self-calculated microseconds, unless you split it in date and time parts, in which case you still have to handle the micro-second part yourself!