Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2002
    Location
    Toronto, Canada
    Posts
    76

    Unanswered: update: adding a month to all of the timestamps?

    I have a table and it has a column named dateinserted with is a timestamp type.

    How could I update the column so that all the months are up by 1?

    obviously the following wouldn't work, since u r suppose to set a column
    update tbl set datepart('hour',dateinserted) = datepart('hour',dateinserted) + 1

    Thanks in advance.

  2. #2
    Join Date
    Apr 2003
    Location
    Tunisia
    Posts
    192

    Re: update: adding a month to all of the timestamps?

    That depends of what do u use , I advice to treate the fact out of the databse that to export it ; if u use a shell just add a month if use a programming language as C or Delphi just do it there then export the whole data in the table !

  3. #3
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    try

    update tbl set dateinserted= dateinserted + interval '1 month'

    rudy
    http://rudy.ca/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •