db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Knut Anders Hatlen <knut.hat...@oracle.com>
Subject Re: Date manipulation in Derby
Date Tue, 03 May 2011 11:46:26 GMT
hezjing <hezjing@gmail.com> writes:

> Hi
>
>
> With MySQL, I can actually manipulate the date using the built-in
> function like:
>
> SELECT DATE_ADD('2010-12-31 23:59:59', INTERVAL 1 DAY)
>
> May I know if there is similar function in Derby? How do we manipulate
> the date in Deby?

Derby supports the JDBC escape function TIMESTAMPADD, documented here:
http://db.apache.org/derby/docs/10.8/ref/rrefjdbc88908.html

Example:

ij> values {fn timestampadd(SQL_TSI_DAY, 1, timestamp('2010-12-31 23:59:59'))};
1                            
-----------------------------
2011-01-01 23:59:59.0        

1 row selected


-- 
Knut Anders

Mime
View raw message