tags:

views:

17

answers:

2

In my database i have a TIMESTAMP field.Now I want to find the difference between the value stored in this field and the current TIMESTAMP .I want the result in days. How can i get it?

Note:I am using DB2 database

A: 
days(TIMESTAMP)_-days(your_col)
Madhivanan
thanks for replying but i am geting error with that.I usedSELECT days(TIMESTAMP) - days(mycol) FROM DB2ADMIN.tablename ;
aks
what was the error?
Madhivanan
A: 

You don't say what version of DB2 you're using.

In older versions, you have to SELECT against a table, even though you're not retrieving any columns.

SELECT days(TIMESTAMP)-days(your_col)
FROM SYSIBM.SYSTABLES

Substitute a creator and table that you have SELECT authority for.

Gilbert Le Blanc