I have got two columns in DB2:
name:time_st type: timestamp
name:duration type: integer (means secundum)
example:
time_st: 2013-02-15 18:10:00 0000
duration: 300
task:
time_st-duration:
2013-02-15 18:10:00 - 300 sec, expected result: 2013-02-15 18:05:00
I tried but not working (in framework manager)
-> timestampadd(2, duration, time_st)
-> time_st - duration second (like currenttime - 3 second)
How can I solve it?
any idea?
donlkj
I am not sure what studio you are working in but there is an easy solution in Report Studio. Add a new data item to your query, go to the Functions tabs, then the Constants folder and grab an item called 'interval minute'. It inserts a '0 minute' but you can change this and the add or subtract this item to your timestamp item. I am attaching my results. I changed the interval to say '5 minute'.
OK, but I would like to use 2 columns.( instead of constant.)
I have got a timestamp column, and from this timestamp column I would like to subtract an other column (which is integer).
And if it possible in the model.
You could write an SQL query subject using DB2 syntax that allows using the seconds,microseconds etc definitions:
Select sometable.sometimestamp-(othertable.value)/1000 microseconds from ......................