Results 1 to 2 of 2

Thread: update query

  1. #1
    Join Date
    Apr 2009

    Unanswered: update query

    I have a table with the column dateapproved and in another table another column yearofapproval

    i would want to extract the 'YYYY' from the dateapproved from table A and update it onto table B's column yearofapproval.

    how to write a query for this? kindly advise.. thanks.

  2. #2
    Join Date
    Apr 2002
    Toronto, Canada
    what you asked is what you get --
    UPDATE TableB
       SET yearofapproval = ( SELECT MAX(YEAR(dateapproved)) FROM tableA ) | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

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