Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2002
    Location
    KY
    Posts
    56

    Exclamation Unanswered: I'm getting a subquery returned more than 1 value error. Please Help!!!

    The error is occurring in the where clause that I spaced out down below, Its dealing with the State_No I know for a fact. I can't figure out how to run it in the Query anzlyzer to relate to match up with another table

    PLEASE HELP!!!!!!

    This is the error I'm getting in the DTS package i ran and query analyzer:
    Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.

    Update HBC_Boiler_Inspection
    set Safety_Valve_Cap = '" & rs1 ("Safety_Valve_Cap") & "', "
    strSQL = strSQL & " Hydro_PSI = '" & rs1 ("Hydro_PSI") & "', "
    strSQL = strSQL & " Hydro_Date = '" & rs1 ("Hydro_Date") & "' "

    strSQL = strSQL & " where Boiler_ID = (Select ID from HBC_Boiler where State_No = " & rs1 ("State_No") & ") "

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

    Boiler_ID IN (Select ID from ...

    caution: this will update all the boilers selected in the subquery

    rudy

Posting Permissions

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