db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kathey Marsden <kmarsdende...@sbcglobal.net>
Subject Re: Difference between two timestamp fields
Date Mon, 04 Jun 2007 20:03:48 GMT
Dmitri Pissarenko wrote:
> Hello!
>
> I need to calculate the difference between two timestamp fields in
> seconds. I tried this query:
>
> SELECT APP.MyTable.startTime, {fn TIMESTAMPDIFF(SQL_TSI_FRAC_SECOND,
> APP.MyTable.startTime, APP.MyTable.endTime)}
> FROM APP.MyTable
> WHERE APP.MyTable IS NOT NULL
Should this be
WHERE APP.MyTable.startTime IS NOT NULL
?
It seems like you should have gotten a message that column APP.MyTable 
does not exist, not the one below. Otherwise your statement looks ok to 
me.  What version are you using?

>
> but it doesn't work, I'm getting the error
>
> SQL State = 42Y07 SQL Code = 30000 SQL Message = Schema 'SYSTEM' does
> not exist Exception message = java.sql.SQLSyntaxErrorException: Schema
> 'SYSTEM' does not exist
>
>
> How can I calculate the difference between two timestamp fields?
>
> TIA
>
> Dmitri Pissarenko



Mime
View raw message