db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jean T. Anderson" <...@bristowhill.com>
Subject Re: Operators & functions
Date Thu, 29 Sep 2005 21:32:23 GMT
Nicolas Dufour wrote:
 > ...
 > I have looked at the reference pdf file, and i found nothing to compute
 > the difference between two timestamps for example, or to convert a
 > timestamp in an integer (in sql only, in java its trivial).


timestampdiff computes the difference between two timestamps. Examples 
are on this page:

    http://db.apache.org/derby/docs/10.1/ref/rrefjdbc88908.html

timestampdiff uses JDBC escape syntax; for example, in ij:

    ij> values CURRENT_TIMESTAMP;
    1
    --------------------------
    2005-09-29 14:30:38.061

    1 row selected
    ij> values {fn TIMESTAMPDIFF(SQL_TSI_WEEK, CURRENT_TIMESTAMP,
      timestamp('2001-01-01-12.00.00.000000'))} ;
    1
    -----------
    -247

    1 row selected


I hope this helps,

  -jean




Mime
View raw message