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
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
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.