Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
TIMESTAMPDIFF

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
Deepatinfy

New User


Joined: 06 Jun 2005
Posts: 7

PostPosted: Fri Jul 08, 2005 4:54 pm    Post subject: TIMESTAMPDIFF
Reply with quote

Hi All,

Can you correct this query for me?

SELECT DF1,TIMESTAMPDIFF(16,DF1) AS DIFF, DAYS('1996-03-01-00.00.01') - DAYS('1995-03-01-00.00.00') AS DAYS
FROM (
SELECT TS1,TS2,CHAR(TS1 - TS2) AS DF1
FROM (
SELECT TIMESTAMP('1996-03-01-00.00.01') AS TS1, TIMESTAMP('1995-03-01-00.00.00') AS TS2
FROM SYSIBM.SYSDUMMY1
)AS TEMP2
)AS TEMP3

The error that shows up is,

QUERY MESSAGES:
NO FUNCTION BY THE NAME TIMESTAMPDIFF HAVING COMPATIBLE ARGUMENTS WAS FOUND

Thanks,
Deepesh
Back to top
View user's profile Send private message

somasundaran_k

Active User


Joined: 03 Jun 2003
Posts: 134

PostPosted: Fri Jul 08, 2005 8:07 pm    Post subject:
Reply with quote

Deepatinfy

TIMESTAMPDIFF is used to find out the difference between two timestamps.But in your query you have specified only one timestamp. It should be something like TIMESTAMPDIFF(16,(DF1-DF2)) where DF1 and DF2 are the two timestamps that you want find out the difference in days.

hth
-Som
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:


Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us