db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stanley Bradbury <Stan.Bradb...@gmail.com>
Subject Re: how i can extract one element of DATETIME field in sql and use it ?
Date Mon, 28 Nov 2005 23:39:35 GMT
Legolas Woodland wrote:

> Hi
> Thank you for reply.
> i get one field for each of a DATETIME element in my table.
> it means that i have : year , month, day , hour, minute, second .
> i do this to be able to use each element in my queries. i find that in 
> Oracle it is possible to extract each of those elements in sql 
> commands and use them.
> now my question is how i can do the same (using a datetime and then 
> access to each of the element) in derby ?
Hi -
Derby uses the TIMESTAMP datatype to store date and time values.  There 
are built-in functions that can be used on a timestamp value to return 
the portions you list.  The complete list of functions can be found at:


The functions you need are the names of elements you list:  YEAR, MONTH, 

View raw message