Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / December 2004

Tip: Looking for answers? Try searching our database.

Having problems with Timestampdiff

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Shishir - 27 Dec 2004 11:21 GMT
The sql
select TIMESTAMPDIFF(1,CHAR(TIMESTAMP('2001-09-29-11.25.42.483219') -
TIMESTAMP('2001-09-26-12.07.58.065497'))) from sysibm.sysdummy1
works in db2 8.1.2/RHEL 2.1
but gives the error
DB2 SQL error: SQLCODE: -443, SQLSTATE: 38552, SQLERRMC:
SYSFUN.TIMESTAMPDIFF;TIMESTAMPDIFF;SYSFUN:03
on db2 8.2/RHEL 3

Any pointers?
Regards
Shishir
Jan M. Nelken - 27 Dec 2004 13:08 GMT
> The sql
> select TIMESTAMPDIFF(1,CHAR(TIMESTAMP('2001-09-29-11.25.42.483219') -
[quoted text clipped - 8 lines]
> Regards
> Shishir

Function TIMESTAMPDIFF returns an INTEGER (signed INTEGER) representing number
of units (units selected by value of first argument) in the Timestamp Duration
represented by second argument.

In your case first argument is 1 - which represents microseconds, second
argument is timestamp duration of 2231744.417722 seconds.
Convertion of this duration to microseconds and storing result into an INTEGER
is impossible.

Jan M. Nelken
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.