Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2010
    Posts
    4

    Unanswered: Copying records in a table with new date

    Hi, I dont know if this is possible but I have a PM system that have to copy and past records to and change the year of the date, this is very time consuming, does anyone know how to copy all the records in the table with the same year in the date then paste them with the next years date

    thanks

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    How about

    INSERT INTO TableName(Field1, DateField)
    SELECT Field1, DateSerial(Year(DateField) + 1, Month(DateField), Day(DateField))
    FROM TableName
    Paul

  3. #3
    Join Date
    Dec 2010
    Posts
    4
    Thanks, that worked perfectly

  4. #4
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    No problemo.
    Paul

Posting Permissions

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