timstampadd function

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • reeteshsingh
    New Member
    • Feb 2008
    • 1

    timstampadd function

    All,
    I am using ibm db2 8 release. i found out that timestampadd function is available only in version 9 not in 8.
    can you please suggest if there is any similar function available in version 8 or otherwise how can i handle adding hours in timestamp, so that it increases date in timestamp it total number of hours crosses 24.

    pls suggest
    thnx in advance
    rgds
    reetesh
  • docdiesel
    Recognized Expert Contributor
    • Aug 2007
    • 297

    #2
    Hi,

    simply add "x hours" to your timestamp, like in this example:

    Code:
    select (current timestamp) as today from sysibm.sysdummy1
    
    TODAY
    --------------------------
    2008-02-18-17.53.17.290019
    
      1 record(s) selected.
    
    select (current timestamp [U]+ 24 hours[/U]) as tomorrow_same_time from sysibm.sysdummy1
    
    TOMORROW
    --------------------------
    2008-02-[U]19[/U]-17.53.27.849947
    
      1 record(s) selected.
    Does this cover your needs?

    Regards,

    Bernd

    Comment

    Working...