Results 1 to 2 of 2

Thread: SQL Problem

  1. #1
    Join Date
    Sep 2005
    Posts
    21

    Unanswered: SQL Problem

    Can anyone see the problem with this SQL query
    I keep getting Incorrect syntax near the keyword 'Update'.

    Code:
    Update Tri_EventHeader
    Set Tri_EventHeader.Urgency = t2.Urgency,
    Tri_EventHeader.ClinicType1 = t2.ClinicType1,
    Tri_EventHeader.ClinicType2 = t2.ClinicType2
    From (Select * From Tri_SelectDoTriage Where Triage_ID = 1) as t2
    Where Tri_EventHeader.Triage_ID = 1

    I am stumped.

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    I wonder if you are looking for something more like
    Code:
    Update Tri_EventHeader
    Set Urgency = t2.Urgency,
    ClinicType1 = t2.ClinicType1,
    ClinicType2 = t2.ClinicType2 
    From Tri_SelectDoTriage t2 
    INNER JOIN
    Tri_EventHeader ON
    t2.Triage_ID = Tri_EventHeader.Triage_ID
    WHERE t2.Triage_ID = 1
    ??

    Otherwise you will need to supply the column(s) that relate the two tables

    HTH
    Testimonial:
    pootle flump
    ur codings are working excelent.

Posting Permissions

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