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

    Exclamation Unanswered: Need help with testing code!!!!

    Can anybody help write this code to test it in SQL query analyzer.
    I'm missing something while writing it and getting this error.

    Syntax error converting the varchar value 'State_No' to a column of data type int. Now in my table's State_No value is a int noto a varchar.

    this is the snippet i wrote:
    Select Safety_Valve_Cap, hydro_PSI, Hydro_Date
    from HBC_Boiler_Inspection
    where Boiler_ID in (Select ID from HBC_Boiler where State_No = ("State_No"))

    this is wrote I'm trying to test the DTS package from:
    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 = " & State_No = " State_No") & ") "

  2. #2
    Join Date
    Jan 2003
    Location
    Pittsburgh, PA
    Posts
    86
    Your field [state_no] is defined as an integer, but you are equating it to a varchar in your query [state_no] = ("state_no"). That is creating your error.

Posting Permissions

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