db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kristian Waagan <Kristian.Waa...@Sun.COM>
Subject Re: How i can have a timeStamp wich point to 30 days ago
Date Tue, 24 Jan 2006 00:59:11 GMT
Legolas Woodland wrote:
> Hi
> Thank you for reading my post
> how i can create a timestamp which point to 30 days ago ?
> i mean a java.sql.Timestamp which point to 30 days ago , from current 
> date.
>
>
>
Hi again,

You can also do this in Derby with the JDBC escape syntax.
Example from ij:
ij> VALUES CURRENT_TIMESTAMP;
1
--------------------------
2006-01-24 01:58:18.118

1 row selected
ij> VALUES {fn TIMESTAMPADD( SQL_TSI_DAY, -30, CURRENT_TIMESTAMP)};
1
--------------------------
2005-12-25 01:58:25.009

1 row selected
ij>

More info can be found here: 
http://db.apache.org/derby/docs/dev/ref/rrefjdbc88908.html


--
Kristian


Mime
View raw message