SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Threaded View

  1. #1
    Knowledge is key 2 progression Tryst's Avatar
    Join Date
    Sep 2003
    Location
    Wales
    Posts
    1,181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Error perform an Aggregate in an UPDATE statement (MS SQL)

    Hi all,

    I am getting an error message when attempting to perform an Aggregate in the SET clause of an UPDATE statement. What I want to do is to update a column in one table with the SUM of two columns from another table - why is this not possible? (I am using MS SQL Server)

    My query is as follows:

    Code:
    UPDATE pts_patient_tran
    SET pts_escorts = SUM(CAST(meridian_test.dbo.escin AS INT) + CAST(meridian_test.dbo.escoutype AS INT))
    WHERE pts_fk_master = meridian_test.dbo.planpatients
    Thanks

    Tryst
    Last edited by Tryst; Jan 24, 2005 at 03:08. Reason: Included the fact that I am using MS SQL


Bookmarks

Posting Permissions

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